...
Using Attribute Names in Searches
When working wit with attributes, instead of attribute IDs you can use column names instead of attribute IDs in api.find filters. In this case, column names are also returned as keys.
- The api.find/stream methods accept field names from the meta data (customized column names).
- The api.find/stream methods accept sort column names from the meta data.
- When field names are used and a raw DB result is returned, the resulting object has keys from the meta data.
- When you use the api.find/stream variant with a List of named fields, you get the result in a hashmap with these fields. When loading a list of entities (i.e. api.find), the function List api.namedEntities(List) has to be called to convert the result of api.find to a list of maps that have keys from meta data.
- When you use the api.find/stream without the List of fields, you get Objects representing the result which can be converted to a List of hashmaps with named fields using api.namedEntities() or iterator.nextNamedEntity(). (When using api.stream(), you can call the method iterator.nextNamedEntity() instead of iterator.next() which returns a map with keys from attribute meta data.)
<EXAMPLE>
Limitations of api.find()
...