Package org.molgenis.model.elements

Examples of org.molgenis.model.elements.Entity.addField()


            // create id field to ensure ordering
            Field idField = new Field(mrefEntity, new IntField(), "autoid", "autoid", true, false, false,
                null);
            idField.setHidden(true);
            idField.setDescription("automatic id field to ensure ordering of mrefs");
            mrefEntity.addField(idField);
            mrefEntity.addKey(idField.getName(), "unique auto key to ensure ordering of mrefs");

            // create the fields for the linktable
            Field field;
            Vector<String> unique = new Vector<String>();
View Full Code Here


            field = new Field(mrefEntity, new XrefField(), xref_field_from.getMrefRemoteid(), null, false,
                false, false, null);
            field.setXRefVariables(xref_entity_to.getName(), xref_field_to.getName(),
                xref_field_from.getXrefLabelNames());
            if (xref_field_from.isXrefCascade()) field.setXrefCascade(true);
            mrefEntity.addField(field);

            unique.add(field.getName());

            // add all the key-fields of xref_entity_from
            for (Field key : xref_entity_from.getKeyFields(Entity.PRIMARY_KEY))
View Full Code Here

                  false, false, false, null);

              // null xreflabel
              field.setXRefVariables(xref_entity_from.getName(), key.getName(), null);

              mrefEntity.addField(field);
              unique.add(field.getName());
            }

            // create the unique combination
            mrefEntity.addKey(unique, false, null);
View Full Code Here

                f.isNillable(), f.isReadOnly(), f.getDefaultValue());
            key_field.setDescription("Primary key field unique in " + entity.getName()
                + " and its subclasses.");
            if (key_field.getType() instanceof StringField) key_field.setVarCharLength(key_field
                .getVarCharLength());
            rootAncestor.addField(key_field);
            keyfields_copy.add(key_field.getName());

            if (f.isAuto())
            {
              // unset auto key in original, but
View Full Code Here

        Field type_field = new Field(rootAncestor, new EnumField(), Field.TYPE_FIELD, Field.TYPE_FIELD, true,
            false, false, null);
        type_field.setDescription("Subtypes of " + entity.getName() + ". Have to be set to allow searching");
        type_field.setEnumOptions(enumOptions);
        type_field.setHidden(true);
        rootAncestor.addField(0, type_field);
      }
    }
  }

  public static void validateNamesAndReservedWords(Model model, MolgenisOptions options)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.