Class EntityHashModelImpl
java.lang.Object
ch.tocco.nice2.templating.impl.freemarker.templatemodel.EntityHashModelImpl
- All Implemented Interfaces:
EntityHashModel
-
Constructor Summary
ConstructorsConstructorDescriptionEntityHashModelImpl(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.booleanexists()Check if entity exists.booleanfieldExists(String name) Check if a field exists on the model.Getter to handle field and relation access to the underlyingEntity@Nullable Entitymodel()Get the model name of the entity.booleanrelationExists(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:EntityHashModelGetter to handle field and relation access to the underlyingEntity- Specified by:
getin interfaceEntityHashModel- Parameters:
key- a field or relation name- Returns:
- the requested field or relation value
- Throws:
freemarker.template.TemplateModelException
-
resolve
Description copied from interface:EntityHashModelResolve a relation while providing an ordering- Specified by:
resolvein interfaceEntityHashModel- Parameters:
relation- the relation to be resolvedorderBy- an ordering clause- Returns:
- the resulting entity list
-
resolve
Description copied from interface:EntityHashModelResolve a relation with ordering and a condition.- Specified by:
resolvein interfaceEntityHashModel- Parameters:
relation- the relation to be resolvedorderBy- an ordering clausewhere- the where clause- Returns:
- the resulting entity list
-
getNiceEntity
- Specified by:
getNiceEntityin interfaceEntityHashModel
-
display
Description copied from interface:EntityHashModelGet the default display of the entity.- Specified by:
displayin interfaceEntityHashModel- Returns:
- the default display fo the entity.
-
display
Description copied from interface:EntityHashModelGet the default display of the entity.- Specified by:
displayin interfaceEntityHashModel- Parameters:
type- display type name- Returns:
- the default display fo the entity.
- See Also:
-
model
Description copied from interface:EntityHashModelGet the model name of the entity.- Specified by:
modelin interfaceEntityHashModel- Returns:
- the name of the model.
-
exists
public boolean exists()Description copied from interface:EntityHashModelCheck if entity exists.- Specified by:
existsin interfaceEntityHashModel- Returns:
- true if it exists, false if not.
-
fieldExists
Description copied from interface:EntityHashModelCheck if a field exists on the model.- Specified by:
fieldExistsin interfaceEntityHashModel- Returns:
- true if it exists, false if not.
-
relationExists
Description copied from interface:EntityHashModelCheck if a relation exists on the model.- Specified by:
relationExistsin interfaceEntityHashModel- Returns:
- true if it exists, false if not.
-