Class ItemPathResolver
- java.lang.Object
-
- com.evolveum.midpoint.repo.sql.query2.resolution.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
-
-
Constructor Summary
Constructors Constructor Description ItemPathResolver(InterpretationContext interpretationContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
addTextInfoJoin(String currentHqlPath)
<T extends JpaDataNodeDefinition>
ProperDataSearchResult<T>findProperDataDefinition(JpaEntityDefinition baseEntityDefinition, ItemPath path, ItemDefinition itemDefinition, Class<T> clazz, PrismContext prismContext)
Finds the proper definition for (possibly abstract) entity.JpaEntityDefinition
findRestrictedEntityDefinition(JpaEntityDefinition baseEntityDefinition, QName specificTypeName)
Given existing entity definition and a request for narrowing it, tries to find refined definition.HqlDataInstance
resolveItemPath(ItemPath relativePath, ItemDefinition itemDefinition, HqlDataInstance baseDataInstance, boolean singletonOnly)
HqlDataInstance
resolveItemPath(ItemPath relativePath, ItemDefinition itemDefinition, String currentHqlPath, JpaEntityDefinition baseEntityDefinition, boolean reuseMultivaluedJoins)
Resolves item path by creating a sequence of resolution states and preparing joins that are used to access JPA properties.
-
-
-
Constructor Detail
-
ItemPathResolver
public ItemPathResolver(InterpretationContext interpretationContext)
-
-
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
-
resolveItemPath
public HqlDataInstance resolveItemPath(ItemPath relativePath, ItemDefinition itemDefinition, HqlDataInstance baseDataInstance, boolean singletonOnly) throws QueryException
- Throws:
QueryException
-
findProperDataDefinition
public <T extends JpaDataNodeDefinition> 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" propertiesclazz
- Kind of definition to be looked for- Returns:
- Entity type definition + item definition, or null if nothing was found
- Throws:
QueryException
-
findRestrictedEntityDefinition
public JpaEntityDefinition findRestrictedEntityDefinition(JpaEntityDefinition baseEntityDefinition, QName specificTypeName) throws QueryException
Given existing entity definition and a request for narrowing it, tries to find refined definition.- Throws:
QueryException
-
-