public class Entity extends DBSchema implements Record
| Modifier and Type | Field and Description |
|---|---|
static int |
PRIMARY_KEY
Convenience variable for retrieving the primary key from the keys
|
name, parentName, treeElements| Constructor and Description |
|---|
Entity(String name,
DBSchema parent)
Default constructor.
|
Entity(String name,
String label,
DBSchema parent)
Default constructor.
|
Entity(String name,
String label,
DBSchema parent,
boolean system)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addField(Field field)
Adds the given field to the list of fields associated with this entity.
|
void |
addField(Integer pos,
Field field)
Adds the given field to the list of fields associated with this entity.
|
void |
addIndex(Index index)
Adds the given index to the list of indices associated with this entity.
|
void |
addKey(List<String> keys,
boolean subclass,
String description)
Adds the given list of fields to the key-list.
|
void |
addKey(String key,
String description)
Adds the given field to the key-list.
|
void |
addReference(Field f) |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
Vector<Field> |
getAddFields() |
Vector<Field> |
getAllAddFields() |
Vector<Entity> |
getAllAncestors() |
Vector<Entity> |
getAllDescendants() |
Field |
getAllField(String name)
Returns the field with the given name from entity or any of its parents.
|
Vector<Field> |
getAllFields() |
Vector<Field> |
getAllFieldsOf(FieldType type) |
Vector<Field> |
getAllFieldsOf(String typeName) |
Vector<Entity> |
getAllImplements() |
Vector<Index> |
getAllIndices() |
Vector<Unique> |
getAllKeys() |
Vector<Field> |
getAllLocalFields()
Returns a vector with all the fields that are actualy located in this entity.
|
Integer |
getAllocationSize() |
Vector<Field> |
getAllUpdateFields() |
Entity |
getAncestor() |
String |
getDecorator() |
List<Entity> |
getDependencies() |
Vector<Entity> |
getDescendants()
Get the subclasses of this entity.
|
String |
getDescription()
Returns the description of the entity.
|
Field |
getField(String name) |
Field |
getField(String name,
boolean required,
boolean recursive,
boolean systemFields)
Returns the field with the given name.
|
Field |
getFieldRecusive(String name) |
List<Field> |
getFields()
Returns a vector with all the fields associated with this entity.
|
List<Field> |
getFields(boolean required,
boolean recursive,
boolean systemField) |
List<Field> |
getFields(boolean required,
boolean recursive,
boolean systemField,
boolean implementing)
Returns a vector with all the fields associated with this entity.
|
Vector<Field> |
getFieldsOf(FieldType type)
Returns a vector with all the fields associated with this entity and are of the given type.
|
Vector<Field> |
getImplementedFields()
Get fields for this entity as well as from the interfaces it implements.
|
Vector<Field> |
getImplementedFieldsOf(FieldType type) |
Vector<Field> |
getImplementedFieldsOf(String typeName) |
Vector<Entity> |
getImplements() |
Vector<String> |
getImplementsNames() |
Index |
getIndex(String name)
Returns the index with the given name.
|
Vector<Index> |
getIndices()
Returns a vector with all the indices associated with this entity.
|
Vector<Field> |
getInheritedFields() |
Unique |
getKey(int index)
Returns the key at the given index.
|
Vector<Field> |
getKeyFields(int index)
Returns a list of the fields that make up the key at the given index.
|
Vector<Unique> |
getKeys()
Returns a list with all the keys.
|
String |
getLabel()
Returns the label of this entity.
|
Vector<Field> |
getLocalFields()
Returns a vector with all the fields that are actualy located in this entity.
|
Model |
getModel() |
Module |
getModule() |
String |
getNamespace() |
List<Field> |
getNonSystemFields(boolean all)
Returns all the fields belonging to this entity, which have not set the system-property.
|
int |
getNumberOfMrefTo(Entity e) |
int |
getNumberOfMrefTo(Entity e,
Field f) |
int |
getNumberOfReferencesTo(Entity e) |
int |
getNumberOfReferencesTo(Entity e,
Field f) |
Vector<String> |
getParents()
Returns all the parents of this entity.
|
Field |
getPrimaryKey() |
Vector<Field> |
getReferences() |
Vector<Field> |
getRemoteFields()
Returns a vector with all the fields that are located in other tables, but belong to this entity (xref_multiple).
|
Entity |
getRootAncestor()
Returns the root of the entity hierarchy this entity belongs to.
|
List<Field> |
getSystemFields(boolean all) |
List<Unique> |
getUniqueKeysWithoutPk() |
List<Field> |
getUserFields() |
List<Field> |
getXRefFields() |
List<String> |
getXrefLabels() |
List<String> |
getXrefLookupFields() |
boolean |
hasAncestor() |
boolean |
hasDescendants() |
int |
hashCode()
Returns a hash code value for the Entity.
|
boolean |
hasImplements() |
boolean |
hasSuperclassField(String fieldname) |
boolean |
hasXRefs() |
boolean |
isAbstract()
Returns whether this entry is abstract
|
boolean |
isAncestor(String entity) |
boolean |
isAssociation() |
boolean |
isImported() |
boolean |
isParent(String parent) |
boolean |
isRootAncestor()
Returns whether this entry has NO parent AND whether it has children' removed.
|
boolean |
isSystem()
Returns whether this entity is system-specific.
|
void |
removeField(Field field) |
void |
setAbstract(boolean is_abstract) |
void |
setAllocationSize(Integer allocationSize) |
void |
setAssociation(boolean association_type) |
void |
setDecorator(String decorator) |
void |
setDescription(String description)
Sets the description of this entity.
|
void |
setImplements(String... implements_parents) |
void |
setImplements(Vector<String> implements_parents) |
void |
setImported(boolean imported) |
void |
setLabel(String label)
Set the label of this entity.
|
void |
setModule(Module module) |
void |
setNamespace(String namespace) |
void |
setParents(String[] parents) |
void |
setParents(Vector<String> parents)
With this method all the parents of this entity can be set in one call.
|
void |
setSystem(boolean isSystem) |
void |
setXrefLabels(List<String> xrefLabels) |
void |
setXrefLookupFields(List<String> xrefLookupFields) |
String |
toString()
Returns a string representation of the Entity.
|
getModules, getSerialVersionUID, setModel, setModulesget, getAllChildren, getAllChildren, getChild, getChildren, getName, getParent, getPath, getRoot, getStringValue, getTreeElements, getValue, hasChildren, hasParent, remove, setName, setName, setParent, setValue, toString, toStringpublic static final int PRIMARY_KEY
public Entity(String name, DBSchema parent)
name - The name of the entity.parent - Pointer to the DBSchema this entity belongs to.public Entity(String name, String label, DBSchema parent)
name - The name of the entity.label - The label of the entity.parent - Pointer to the DBSchema this entity belongs to.public Entity(String name, String label, DBSchema parent, boolean system)
name - The name of the entity.label - The label of the entity.parent - Pointer to the DBSchema this entity belongs to.system - Indicates whether this entity is system-specificpublic boolean isImported()
public void setImported(boolean imported)
public String getLabel()
public void setLabel(String label)
public boolean isSystem()
public boolean isRootAncestor()
public boolean isAbstract()
public void setAbstract(boolean is_abstract)
public boolean isAssociation()
public void setAssociation(boolean association_type)
public String getDescription()
public void setDescription(String description)
public void setParents(Vector<String> parents)
parents - List containing the parents of this entity.public Vector<String> getParents()
getParents in interface Recordpublic Entity getRootAncestor()
public boolean isParent(String parent)
public boolean hasAncestor()
public boolean isAncestor(String entity)
public Entity getAncestor()
public boolean hasDescendants()
public boolean hasImplements()
public Vector<Entity> getImplements() throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Entity> getAllImplements() throws MolgenisModelException
MolgenisModelExceptionpublic void setImplements(String... implements_parents)
public void addReference(Field f)
f - public void addField(Field field) throws MolgenisModelException
field - Pointer to the field that needs to be added.Exception - When a field with the same name is already present.MolgenisModelExceptionpublic void addField(Integer pos, Field field) throws MolgenisModelException
field - Pointer to the field that needs to be added.Exception - When a field with the same name is already present.MolgenisModelExceptionpublic void removeField(Field field)
public List<Field> getFields() throws MolgenisModelException
getFields in interface RecordMolgenisModelExceptionpublic List<Field> getFields(boolean required, boolean recursive, boolean systemField, boolean implementing) throws MolgenisModelException
required - if required == true than returns only fields that are required (not nillable/null) else returns all
fieldsrecursive - get also field from super classessystemField - system field, like __type and idimplementing - field that this object implements (also done recusively if recusive = true)MolgenisModelExceptionpublic List<Field> getFields(boolean required, boolean recursive, boolean systemField) throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getImplementedFields() throws MolgenisModelException
MolgenisModelExceptionpublic boolean hasSuperclassField(String fieldname) throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getInheritedFields() throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getAllFields() throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getAllUpdateFields() throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getLocalFields() throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getAllLocalFields() throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getRemoteFields() throws MolgenisModelException
MolgenisModelExceptionpublic List<Field> getSystemFields(boolean all) throws MolgenisModelException
MolgenisModelExceptionpublic List<Field> getNonSystemFields(boolean all) throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getAllAddFields() throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getAddFields() throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getFieldsOf(FieldType type) throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getAllFieldsOf(FieldType type) throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getAllFieldsOf(String typeName) throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getImplementedFieldsOf(FieldType type) throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Field> getImplementedFieldsOf(String typeName) throws MolgenisModelException
MolgenisModelExceptionpublic List<Field> getXRefFields() throws MolgenisModelException
MolgenisModelExceptionpublic List<Field> getUserFields() throws MolgenisModelException
MolgenisModelExceptionpublic Field getField(String name, boolean required, boolean recursive, boolean systemFields) throws MolgenisModelException
name - The name of the field to look for.MolgenisModelExceptionpublic Field getFieldRecusive(String name) throws MolgenisModelException
MolgenisModelExceptionpublic Field getField(String name) throws MolgenisModelException
MolgenisModelExceptionpublic Field getAllField(String name) throws MolgenisModelException
name - The name of the field to look for.MolgenisModelExceptionpublic void addIndex(Index index)
index - Pointer to the index that needs to be added.Exception - When a index with the same name is already present.public Vector<Index> getIndices() throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Index> getAllIndices() throws MolgenisModelException
MolgenisModelExceptionpublic Index getIndex(String name) throws MolgenisModelException
name - The name of the index to look for.MolgenisModelExceptionpublic void addKey(String key, String description)
key - The field that is a key.public void addKey(List<String> keys, boolean subclass, String description) throws MolgenisModelException
keys - The fields that combined form the key.MolgenisModelExceptionpublic Vector<Unique> getAllKeys() throws MolgenisModelException
MolgenisModelExceptionpublic Vector<Unique> getKeys() throws MolgenisModelException
MolgenisModelExceptionpublic Unique getKey(int index) throws IndexOutOfBoundsException, MolgenisModelException
MolgenisModelExceptionIndexOutOfBoundsExceptionpublic Vector<Field> getKeyFields(int index) throws MolgenisModelException
MolgenisModelExceptionpublic List<Unique> getUniqueKeysWithoutPk() throws MolgenisModelException
MolgenisModelExceptionpublic String toString()
public boolean equals(Object obj)
public int hashCode()
public String getDecorator()
public void setDecorator(String decorator)
public Module getModule()
public void setModule(Module module)
public void setSystem(boolean isSystem)
public String getNamespace()
public void setNamespace(String namespace)
public Field getPrimaryKey() throws MolgenisModelException
MolgenisModelExceptionpublic void setParents(String[] parents)
public int getNumberOfReferencesTo(Entity e) throws MolgenisModelException
MolgenisModelExceptionpublic int getNumberOfReferencesTo(Entity e, Field f) throws MolgenisModelException
MolgenisModelExceptionpublic int getNumberOfMrefTo(Entity e) throws MolgenisModelException
MolgenisModelExceptionpublic int getNumberOfMrefTo(Entity e, Field f) throws MolgenisModelException
MolgenisModelExceptionpublic List<String> getXrefLookupFields() throws MolgenisModelException
MolgenisModelExceptionpublic List<String> getXrefLabels() throws MolgenisModelException
MolgenisModelExceptionpublic List<Entity> getDependencies() throws MolgenisModelException
MolgenisModelExceptionpublic void setAllocationSize(Integer allocationSize)
public Integer getAllocationSize()
Copyright © 2015. All Rights Reserved.