Interface EntityHashModel
- All Known Implementing Classes:
EntityHashModelImpl
,PrivilegedEntityHashModel
public interface EntityHashModel
A hash-representation for an
Entity
, used in freemarker.-
Method Summary
Modifier and TypeMethodDescriptiondisplay()
Get the default display of the entity.Get the default display of the entity.boolean
exists()
Check if entity exists.boolean
fieldExists
(String name) Check if a field exists on the model.Getter to handle field and relation access to the underlyingEntity
@Nullable Entity
model()
Get the model name of the entity.boolean
relationExists
(String name) Check if a relation exists on the model.Resolve a relation while providing an orderingResolve a relation with ordering and a condition.
-
Method Details
-
getNiceEntity
-
get
Getter to handle field and relation access to the underlyingEntity
- Parameters:
key
- a field or relation name- Returns:
- the requested field or relation value
- Throws:
freemarker.template.TemplateModelException
-
resolve
Resolve a relation while providing an ordering- Parameters:
relation
- the relation to be resolvedorderBy
- an ordering clause- Returns:
- the resulting entity list
-
resolve
Resolve a relation with ordering and a condition.- Parameters:
relation
- the relation to be resolvedorderBy
- an ordering clausewhere
- the where clause- Returns:
- the resulting entity list
-
display
String display()Get the default display of the entity.- Returns:
- the default display fo the entity.
-
display
Get the default display of the entity.- Parameters:
type
- display type name- Returns:
- the default display fo the entity.
- See Also:
-
model
String model()Get the model name of the entity.- Returns:
- the name of the model.
-
exists
boolean exists()Check if entity exists.- Returns:
- true if it exists, false if not.
-
fieldExists
Check if a field exists on the model.- Returns:
- true if it exists, false if not.
-
relationExists
Check if a relation exists on the model.- Returns:
- true if it exists, false if not.
-