public interface Entity extends EntityMessagesHolder
FieldDefinition.getName()
.Modifier and Type | Method and Description |
---|---|
Entity |
copy()
Create new entity and copy fields values.
|
Entity |
getBelongsToField(String fieldName)
Return the value, casted to entity, of the field with given name.
|
boolean |
getBooleanField(String fieldName)
Return the boolean value of the field with given name
|
DataDefinition |
getDataDefinition()
Return the entity's dataDefinition.
|
Date |
getDateField(String fieldName)
Return the Date value of the field with given name
|
BigDecimal |
getDecimalField(String fieldName)
Return the decimal (java.math.BigDecimal) value of the field with given
name
|
Object |
getField(String fieldName)
Return the value of the field with given name.
|
Map<String,Object> |
getFields()
Return all field's values.
|
EntityList |
getHasManyField(String fieldName)
Return the value, casted to list of entities, of the field with given
name.
|
Long |
getId()
Return the entity's id.
|
Integer |
getIntegerField(String fieldName)
Return the Integer value of the field with given name
|
Long |
getLongField(String fieldName)
Return the Long value of the field with given name
|
List<Entity> |
getManyToManyField(String fieldName)
Return the value, casted to list of entities, of the field with given
name.
|
String |
getStringField(String fieldName)
Return the value, casted to string, of the field with given name.
|
EntityTree |
getTreeField(String fieldName)
Return the value, casted to tree, of the field with given name.
|
boolean |
isActive()
Returns true if entity is active.
|
boolean |
isCopied() |
boolean |
isFieldValid(String fieldName)
Return true if there is no field's errors for given field.
|
boolean |
isValid()
Return true if there is no global and field's errors.
|
void |
setActive(boolean active)
Set if entity is active.
|
void |
setCopied(boolean copied) |
void |
setField(String fieldName,
Object fieldValue)
Set the value of the field with given name.
|
void |
setId(Long id)
Set the entity's id.
|
void |
setNotValid()
Set validation status as not valid
|
addError, addGlobalError, addGlobalError, addGlobalError, addGlobalMessage, addGlobalMessage, getError, getErrors, getGlobalErrors, getGlobalMessages
Entity copy()
DataDefinition.copy(Long...)
Entity getBelongsToField(String fieldName)
fieldName
- field's nameIllegalArgumentException
- if given field is not belongsTo typeboolean getBooleanField(String fieldName)
fieldName
- field's nameDataDefinition getDataDefinition()
Date getDateField(String fieldName)
fieldName
- field's nameIllegalArgumentException
BigDecimal getDecimalField(String fieldName)
fieldName
- field's nameIllegalArgumentException
- if given field is not BigDecimal
(sub)typeObject getField(String fieldName)
fieldName
- field's nameMap<String,Object> getFields()
EntityList getHasManyField(String fieldName)
fieldName
- field's nameIllegalArgumentException
- if given field have incompatible typeLong getId()
Integer getIntegerField(String fieldName)
fieldName
- field's nameIllegalArgumentException
- if given field is not Integer typeLong getLongField(String fieldName)
fieldName
- field's nameIllegalArgumentException
- if given field is not Integer typeList<Entity> getManyToManyField(String fieldName)
fieldName
- field's nameString getStringField(String fieldName)
fieldName
- field's nameEntityTree getTreeField(String fieldName)
fieldName
- field's nameboolean isActive()
boolean isCopied()
boolean isFieldValid(String fieldName)
fieldName
- field's nameboolean isValid()
void setActive(boolean active)
active
- is activevoid setCopied(boolean copied)
void setField(String fieldName, Object fieldValue)
fieldName
- field's namefieldValue
- field'valuevoid setId(Long id)
id
- the entity's namevoid setNotValid()
Copyright © 2010-2025 Qcadoo Limited