Class ReadEntityQueryContext

java.lang.Object
io.jmix.data.accesscontext.ReadEntityQueryContext
All Implemented Interfaces:
AccessContext

public class ReadEntityQueryContext extends Object implements AccessContext
Defines an authorization point for modifying JPQL queries by adding JOIN and WHERE clauses.
  • Field Details

  • Constructor Details

  • Method Details

    • getEntityClass

      public MetaClass getEntityClass()
    • addJoinAndWhere

      public void addJoinAndWhere(String join, String where)
    • getResultQuery

      public JmixQuery getResultQuery()
    • buildQuery

      protected void buildQuery()
    • actualizePlaceholder

      protected String actualizePlaceholder(String queryPart, String actualEntityName, String actualEntityPath)
      Replaces QueryTransformer.ALIAS_PLACEHOLDER with actual entity path if query returns nested entity instead of the one specified in from clause.

      Example: select u.group from sec$User u
      u.group should be used instead of {E}. Otherwise, constraint will be applied to the user instead of the group.

      Parameters:
      queryPart - to actualize
      actualEntityName - nested entity or null if query return type is the same as type in from clause
      actualEntityPath - query return entity path
      Returns:
      queryPart with replaced placeholder if needed
    • printQuery

      protected static String printQuery(String query)
    • explainConstraints

      @Nullable public String explainConstraints()
      Description copied from interface: AccessContext
      Returns a human-readable explanation of constraints applied to the current context instance for logging of authorization decisions. Null if the current context does not impose any constraints.
      Specified by:
      explainConstraints in interface AccessContext