Package com.axelor.meta.query.backend
Class CustomFields
java.lang.Object
com.axelor.meta.query.backend.CustomFields
How a custom field (
MetaJsonField) is typed and read in a query, wherever it is stored:
in a custom model's record, or in the JSON column of an entity the field was added to.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanRead(User user, MetaJsonField field) Whether the user may read the field: open to all unless it names roles.static Stringrender(String alias, String column, ResolvedField field) The field's value read out ofalias's JSONcolumn.static StringrenderRelationJoin(QueryJoinClause.RelationJoin join, String column, Function<Object, String> binder) Joins the target of a to-one custom relation stored in the source's JSONcolumn.static ResolvedFieldresolve(MetaJsonField field, String column) The field as the analyzer sees it, stored undercolumn(null for a custom model).
-
Method Details
-
resolve
The field as the analyzer sees it, stored undercolumn(null for a custom model). -
render
The field's value read out ofalias's JSONcolumn. -
renderRelationJoin
public static String renderRelationJoin(QueryJoinClause.RelationJoin join, String column, Function<Object, String> binder) Joins the target of a to-one custom relation stored in the source's JSONcolumn. JPQL cannot navigate a path stored in JSON, so the target is joined on the id it holds. -
canRead
Whether the user may read the field: open to all unless it names roles.
-