public class Field extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE_FIELD |
| Constructor and Description |
|---|
Field(Entity parent,
FieldType type,
String name,
String label,
boolean auto,
boolean nillable,
boolean readonly,
String default_value)
Standard constructor, which sets all the common variables for a field.
|
Field(Entity parent,
FieldType type,
String name,
String label,
boolean auto,
boolean nillable,
boolean readonly,
String default_value,
String jpaCascade)
Standard constructor, which sets all the common variables for a field.
|
Field(Entity parent,
String name,
FieldType type) |
Field(Field field)
copy-constructor
|
Field(String name) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,List<Field>> |
allPossibleXrefLabels() |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
String |
getAnnotations() |
String |
getDefaultCode() |
String |
getDefaultValue()
Returns the value the database should set for the field when there is no value set.
|
String |
getDescription()
Returns the description of the entity.
|
Entity |
getEntity() |
Vector<String> |
getEnumOptions() |
String |
getFilterfield() |
String |
getFiltertype() |
String |
getFiltervalue() |
String |
getFormatString() |
String |
getJpaCascade() |
String |
getLabel()
This method returns the label of this field.
|
Integer |
getLength() |
Long |
getMaxRange() |
Long |
getMinRange() |
String |
getMrefLocalid() |
String |
getMrefName()
Gets the name of the link-table when this field is a XREF_MULTIPLE.
|
String |
getMrefRemoteid() |
String |
getName()
This method returns the name of this field.
|
Entity |
getParent()
Deprecated.
|
String |
getSqlName() |
String |
getTableName() |
FieldType |
getType()
This method returns the type of this field.
|
Object |
getUserData() |
int |
getVarCharLength()
When this field is of type Type.VARCHAR, this method returns the maximum length the varchar can be.
|
Entity |
getXrefEntity()
Returns the name of the entity this field is referencing to.
|
String |
getXrefEntityName() |
Field |
getXrefField()
Returns the name of the field of the entity this field is referencing to.
|
String |
getXrefFieldName() |
List<String> |
getXrefLabelNames()
Returns the label of this reference.
|
List<Field> |
getXrefLabelPath(String label) |
List<Field> |
getXrefLabels() |
List<String> |
getXrefLabelsTemp() |
SimpleTree<SimpleTree<?>> |
getXrefLabelTree()
Return a tree wich describes the path to xref labels.
|
SimpleTree<SimpleTree<?>> |
getXrefLabelTree(boolean useJavaNames) |
protected void |
getXrefLabelTree(List<String> labels,
SimpleTree<?> parent)
Creates a tree with leafs that match labels and nodes that match entities.
|
protected void |
getXrefLabelTree(List<String> labels,
SimpleTree<?> parent,
boolean useJavaNames)
Creates a tree with leafs that match labels and nodes that match entities.
|
boolean |
hasFilter() |
int |
hashCode()
Returns a hash code value for the Field.
|
boolean |
isAggregateable() |
boolean |
isAuto()
Returns whether this field is auto-assigned by the database.
|
boolean |
isCyclic() |
boolean |
isEnum()
Returns whether this field has enum options.
|
boolean |
isHidden() |
boolean |
isLocal()
Returns whether this field is locally available in the table, or whether it is located in another table (for
example link-table).
|
boolean |
isMRef()
Returns whether this field is a mref.
|
boolean |
isNillable()
Returns whether this field can be NULL in the database.
|
boolean |
isReadOnly()
Returns whether this field is read-only in the database.
|
boolean |
isSystem()
Returns whether this field is a system-field.
|
boolean |
isUnique()
If this a unique field? If this field is part of a compound key it will return false
|
boolean |
isXRef()
Returns whether this field is a xref.
|
boolean |
isXrefCascade() |
void |
setAggregateable(boolean aggregateable) |
void |
setAnnotations(String annotations) |
void |
setAuto(boolean auto) |
void |
setDefaultCode(String default_code) |
void |
setDescription(String description)
Sets the description of this entity.
|
void |
setDevaultValue(String value) |
void |
setEntity(Entity entity) |
void |
setEnumOptions(Vector<String> options) |
void |
setFilter(boolean filter) |
void |
setFilterfield(String filterfield) |
void |
setFiltertype(String filtertype) |
void |
setFiltervalue(String filtervalue) |
void |
setHidden(boolean hidden) |
void |
setJpaCascade(String jpaCascade) |
void |
setLabel(String label) |
void |
setMaxRange(Long maxRange) |
void |
setMinRange(Long minRange) |
void |
setMrefLocalid(String mref_localid) |
void |
setMrefName(String linktable)
Sets the name of the link-table when this field is a XREF_MULTIPLE.
|
void |
setMrefRemoteid(String mref_remoteid) |
void |
setName(String name) |
void |
setNillable(boolean nillable) |
void |
setReadonly(boolean readonly) |
void |
setSystem(boolean s)
With this set-function the system-property can be set.
|
void |
setTableName(String tableName) |
void |
setType(FieldType type) |
void |
setUserData(Object obj) |
void |
setVarCharLength(int length)
When this field is of type Type.VARCHAR, this method sets the maximum length the varchar can be.
|
void |
setXrefCascade(boolean xrefCascade) |
void |
setXRefEntity(String xref_entity) |
void |
setXrefField(String xrefField) |
void |
setXrefLabelNames(List<String> labelNames) |
void |
setXRefVariables(String entity,
String field,
List<String> labels)
With this method all the additional information for this xref-field can be set.
|
String |
toString()
Returns a string representation of the Field.
|
public static final String TYPE_FIELD
public Field(Entity parent, FieldType type, String name, String label, boolean auto, boolean nillable, boolean readonly, String default_value, String jpaCascade)
type - The type of the field.name - The name of the field, which needs to be unique for the entity.label - The label of the field, which is used for the user interface.auto - Indicates whether this field needs to assigned a value by the database.nillable - Indicates whether this field can have the value NULL in the database.readonly - Indicates whether this field is readonly.jpaCascade - Makes it possible to use JPA Cascade options to streamline object datbase interaction, see JPA
documentation for detailspublic Field(String name)
public Field(Entity parent, FieldType type, String name, String label, boolean auto, boolean nillable, boolean readonly, String default_value)
type - The type of the field.name - The name of the field, which needs to be unique for the entity.label - The label of the field, which is used for the user interface.auto - Indicates whether this field needs to assigned a value by the database.nillable - Indicates whether this field can have the value NULL in the database.readonly - Indicates whether this field is readonly.public Field(Field field)
@Deprecated public Entity getParent()
public Entity getEntity()
public FieldType getType()
public void setType(FieldType type)
type - public String getFormatString()
public String getName()
public void setName(String name)
public String getLabel()
public void setLabel(String label)
public void setAuto(boolean auto)
public boolean isAuto()
public boolean isNillable()
public boolean isAggregateable()
public void setAggregateable(boolean aggregateable)
public void setReadonly(boolean readonly)
public boolean isHidden()
public void setHidden(boolean hidden)
public boolean isReadOnly()
public boolean isSystem()
public void setSystem(boolean s)
s - The system boolean.public boolean isLocal()
public boolean isCyclic()
throws MolgenisModelException
MolgenisModelExceptionpublic boolean isEnum()
public boolean isXRef()
public boolean isMRef()
public String getDefaultValue()
public void setDevaultValue(String value)
public String getDescription()
public void setDescription(String description)
public Vector<String> getEnumOptions() throws MolgenisModelException
MolgenisModelExceptionpublic void setVarCharLength(int length)
length - The maximum length the varchar field can be.Exception - When the field is not of type Type.VARCHAR.public int getVarCharLength()
throws MolgenisModelException
Exception - When the field is not of type Type.VARCHAR.MolgenisModelExceptionpublic void setXRefEntity(String xref_entity)
public void setXRefVariables(String entity, String field, List<String> labels)
entity - The entity this field references.field - The field of the entity this field references.label - The label of this xref.Exception - When this field is not of type Type.XREF_SINGLE or Type.XREF_MULTIPLEpublic Entity getXrefEntity() throws MolgenisModelException
Exception - When this field is not of type Type.XREF_SINGLE or Type.XREF_MULTIPLEMolgenisModelExceptionpublic String getXrefEntityName() throws MolgenisModelException
MolgenisModelExceptionpublic Field getXrefField() throws MolgenisModelException
ExceptionException - When this field is not of type Type.XREF_SINGLE or Type.XREF_MULTIPLEMolgenisModelExceptionpublic String getXrefFieldName()
public List<String> getXrefLabelNames() throws MolgenisModelException
MolgenisModelExceptionException - When this field is not of type Type.XREF_SINGLE or Type.XREF_MULTIPLEpublic SimpleTree<SimpleTree<?>> getXrefLabelTree() throws MolgenisModelException
MolgenisModelExceptionpublic SimpleTree<SimpleTree<?>> getXrefLabelTree(boolean useJavaNames) throws MolgenisModelException
MolgenisModelExceptionprotected void getXrefLabelTree(List<String> labels, SimpleTree<?> parent) throws MolgenisModelException
labels - to be matchedpath - so far in the tree to allow for recursionMolgenisModelExceptionprotected void getXrefLabelTree(List<String> labels, SimpleTree<?> parent, boolean useJavaNames) throws MolgenisModelException
labels - to be matchedpath - so far in the tree to allow for recursionMolgenisModelExceptionpublic List<Field> getXrefLabelPath(String label) throws MolgenisModelException
MolgenisModelExceptionpublic List<Field> getXrefLabels() throws MolgenisModelException
MolgenisModelExceptionpublic List<String> getXrefLabelsTemp() throws MolgenisModelException
MolgenisModelExceptionpublic String getMrefName()
Exception - When this field is not of type Type.XREF_MULTIPLEpublic void setMrefName(String linktable)
linktable - The name of the linktable.Exception - When this field is not of type Type.XREF_MULTIPLEpublic String getMrefLocalid()
public void setMrefLocalid(String mref_localid)
public String getMrefRemoteid()
public void setMrefRemoteid(String mref_remoteid)
public void setUserData(Object obj)
public Object getUserData()
public String getDefaultCode()
public void setDefaultCode(String default_code)
public String toString()
public boolean equals(Object obj)
public int hashCode()
public String getAnnotations()
public void setAnnotations(String annotations)
public boolean hasFilter()
public void setFilter(boolean filter)
public String getFilterfield()
public void setFilterfield(String filterfield)
public String getFiltertype()
public void setFiltertype(String filtertype)
public String getFiltervalue()
public void setNillable(boolean nillable)
public void setFiltervalue(String filtervalue)
public void setEntity(Entity entity)
public void setXrefField(String xrefField)
public Long getMinRange()
public void setMinRange(Long minRange)
public Long getMaxRange()
public void setMaxRange(Long maxRange)
public Map<String,List<Field>> allPossibleXrefLabels() throws MolgenisModelException
MolgenisModelExceptionpublic Integer getLength() throws MolgenisModelException
MolgenisModelExceptionpublic boolean isXrefCascade()
public void setXrefCascade(boolean xrefCascade)
public String getJpaCascade()
public void setJpaCascade(String jpaCascade)
public void setTableName(String tableName)
public String getTableName()
public String getSqlName()
public boolean isUnique()
throws MolgenisModelException
MolgenisModelExceptionCopyright © 2015. All Rights Reserved.