Class ItemPathResolver


  • public class ItemPathResolver
    extends Object
    Responsible for resolving item paths - i.e. translating them into JPA paths along with creation of necessary joins. Contains also methods that try to find proper specific entity definition when only general one (e.g. RObject) is provided.
    Author:
    mederly
    • Method Detail

      • resolveItemPath

        public HqlDataInstance resolveItemPath​(ItemPath relativePath,
                                               ItemDefinition itemDefinition,
                                               String currentHqlPath,
                                               JpaEntityDefinition baseEntityDefinition,
                                               boolean reuseMultivaluedJoins)
                                        throws QueryException
        Resolves item path by creating a sequence of resolution states and preparing joins that are used to access JPA properties.
        Parameters:
        itemDefinition - Definition for the (final) item pointed to. Optional - necessary only for extension items.
        reuseMultivaluedJoins - Creation of new joins for multivalued properties is forbidden.
        Throws:
        QueryException
      • addTextInfoJoin

        public String addTextInfoJoin​(String currentHqlPath)
      • findProperDataDefinition

        public <T extends JpaDataNodeDefinition<T>> ProperDataSearchResult<T> findProperDataDefinition​(JpaEntityDefinition baseEntityDefinition,
                                                                                                       ItemPath path,
                                                                                                       ItemDefinition itemDefinition,
                                                                                                       Class<T> clazz,
                                                                                                       PrismContext prismContext)
                                                                                                throws QueryException
        Finds the proper definition for (possibly abstract) entity. Returns the most abstract entity that can be used. Checks for conflicts, such as user.locality vs org.locality.
        Parameters:
        path - Path to be found (non-empty!)
        itemDefinition - Definition of target property, required/used only for "any" properties
        clazz - Kind of definition to be looked for
        Returns:
        Entity type definition + item definition, or null if nothing was found
        Throws:
        QueryException