Class GetListKeysMethod
java.lang.Object
ch.tocco.nice2.templating.impl.freemarker.methods.GetListKeysMethod
- All Implemented Interfaces:
freemarker.template.TemplateMethodModel
,freemarker.template.TemplateMethodModelEx
,freemarker.template.TemplateModel
Returns a list of the keys of the entities in a list.
For example, this method is useful if we need the keys of the entities in a query condition, but don't want to loop
over the list to obtain the keys (as this would be very inefficient compared to this method, as an
EntityHashModel
would have to be created for each entity in the list).
Example usage (see the `IN()` condition in the query):
```
[@pathQuery name="relevantRegistrations" paths="relUser.firstname,relUser.lastname,relEvent.label"]
find Registration
where relRegistration_status.unique_id == "booked"
and IN(pk, [#list getListKeys(baseData) as key]${key?c}[#sep],[/#sep][/#list])
[/@pathQuery]
```-
Field Summary
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
GetListKeysMethod
public GetListKeysMethod()
-
-
Method Details
-
exec
- Specified by:
exec
in interfacefreemarker.template.TemplateMethodModel
- Specified by:
exec
in interfacefreemarker.template.TemplateMethodModelEx
- Throws:
freemarker.template.TemplateModelException
-