Class EntityHashModelImpl
java.lang.Object
ch.tocco.nice2.templating.impl.freemarker.templatemodel.EntityHashModelImpl
- All Implemented Interfaces:
EntityHashModel
-
Constructor Summary
ConstructorDescriptionEntityHashModelImpl
(Context context, EntityModel model, freemarker.template.ObjectWrapper objectWrapper, DefaultDisplayService defaultDisplayService, QueryBuilderFactory queryBuilderFactory) Create a EntityHashModel for a null entity.EntityHashModelImpl
(Context contextService, Entity niceEntity, freemarker.template.ObjectWrapper objectWrapper, DefaultDisplayService defaultDisplayService, QueryBuilderFactory queryBuilderFactory) -
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.
-
Constructor Details
-
EntityHashModelImpl
public EntityHashModelImpl(Context contextService, Entity niceEntity, freemarker.template.ObjectWrapper objectWrapper, DefaultDisplayService defaultDisplayService, QueryBuilderFactory queryBuilderFactory) -
EntityHashModelImpl
public EntityHashModelImpl(Context context, EntityModel model, freemarker.template.ObjectWrapper objectWrapper, DefaultDisplayService defaultDisplayService, QueryBuilderFactory queryBuilderFactory) Create a EntityHashModel for a null entity.
-
-
Method Details
-
get
Description copied from interface:EntityHashModel
Getter to handle field and relation access to the underlyingEntity
- Specified by:
get
in interfaceEntityHashModel
- Parameters:
key
- a field or relation name- Returns:
- the requested field or relation value
- Throws:
freemarker.template.TemplateModelException
-
resolve
Description copied from interface:EntityHashModel
Resolve a relation while providing an ordering- Specified by:
resolve
in interfaceEntityHashModel
- Parameters:
relation
- the relation to be resolvedorderBy
- an ordering clause- Returns:
- the resulting entity list
-
resolve
Description copied from interface:EntityHashModel
Resolve a relation with ordering and a condition.- Specified by:
resolve
in interfaceEntityHashModel
- Parameters:
relation
- the relation to be resolvedorderBy
- an ordering clausewhere
- the where clause- Returns:
- the resulting entity list
-
getNiceEntity
- Specified by:
getNiceEntity
in interfaceEntityHashModel
-
display
Description copied from interface:EntityHashModel
Get the default display of the entity.- Specified by:
display
in interfaceEntityHashModel
- Returns:
- the default display fo the entity.
-
display
Description copied from interface:EntityHashModel
Get the default display of the entity.- Specified by:
display
in interfaceEntityHashModel
- Parameters:
type
- display type name- Returns:
- the default display fo the entity.
- See Also:
-
model
Description copied from interface:EntityHashModel
Get the model name of the entity.- Specified by:
model
in interfaceEntityHashModel
- Returns:
- the name of the model.
-
exists
public boolean exists()Description copied from interface:EntityHashModel
Check if entity exists.- Specified by:
exists
in interfaceEntityHashModel
- Returns:
- true if it exists, false if not.
-
fieldExists
Description copied from interface:EntityHashModel
Check if a field exists on the model.- Specified by:
fieldExists
in interfaceEntityHashModel
- Returns:
- true if it exists, false if not.
-
relationExists
Description copied from interface:EntityHashModel
Check if a relation exists on the model.- Specified by:
relationExists
in interfaceEntityHashModel
- Returns:
- true if it exists, false if not.
-