Class CustomFields

java.lang.Object
com.axelor.meta.query.backend.CustomFields

public final class CustomFields extends Object
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 Details

    • resolve

      public static ResolvedField resolve(MetaJsonField field, String column)
      The field as the analyzer sees it, stored under column (null for a custom model).
    • render

      public static String render(String alias, String column, ResolvedField field)
      The field's value read out of alias's JSON column.
    • 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 JSON column. JPQL cannot navigate a path stored in JSON, so the target is joined on the id it holds.
    • canRead

      public static boolean canRead(User user, MetaJsonField field)
      Whether the user may read the field: open to all unless it names roles.