Class JpaDataNodeDefinition<T extends JpaDataNodeDefinition<T>>
- java.lang.Object
-
- com.evolveum.midpoint.repo.sql.query.definition.JpaDataNodeDefinition<T>
-
- Type Parameters:
T
- represents current type in the hierarchy of JpaDataNodeDefinition-s
- All Implemented Interfaces:
Visitable<JpaDataNodeDefinition<T>>
,DebugDumpable
- Direct Known Subclasses:
JpaAnyContainerDefinition
,JpaEntityDefinition
,JpaEntityPointerDefinition
,JpaPropertyDefinition
,JpaReferenceDefinition
public abstract class JpaDataNodeDefinition<T extends JpaDataNodeDefinition<T>> extends Object implements DebugDumpable, Visitable<JpaDataNodeDefinition<T>>
Defines piece of JPA data - entity, property, reference, or "any" container. Used to convert ItemPath to HQL query, or, specifically, to a property path with left outer joins where appropriate.The conversion works like running state machine where data definitions are states, and transitions are labeled with non-empty ItemPaths. Input paths are used to navigate through states until all of input path is consumed.
In addition to recognize input paths, this automaton produces HQL path and property joins. That's why each possible transition is labeled with (ItemPath prefix, JPA name, other transition data) tuple. ItemPath prefix is used to match the input path, while JPA name + other transition data, along with target state information (potentially) are used to generate HQL property path with appropriate join, if necessary.
Note that some transitions may have empty JPA name - when the data is contained directly in owner entity (e.g. object extension, shadow attributes). Most transitions have single item paths. However, some have two, e.g. construction/resourceRef, owner/id, metadata/*.
By other transition data we currently mean: collection specification, or "embedded" flag.
Terminology: - state ~ data node (JpaDataNodeDefinition -> JpaEntityDefinition, JpaPropertyDefinition, ...) - transition ~ link node (JpaLinkDefinition)
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description JpaDataNodeDefinition(@NotNull Class<?> jpaClass, @Nullable Class<?> jaxbClass)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract String
getDebugDumpClassName()
@Nullable Class<?>
getJaxbClass()
@NotNull Class<?>
getJpaClass()
String
getJpaClassName()
String
getShortInfo()
abstract DataSearchResult<?>
nextLinkDefinition(ItemPath path, ItemDefinition<?> itemDefinition, PrismContext prismContext)
Tries to find "next step" in the translation process for a given ItemPath.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazily
-
-
-
-
Method Detail
-
getJpaClass
@NotNull public @NotNull Class<?> getJpaClass()
-
getJpaClassName
public String getJpaClassName()
-
getJaxbClass
@Nullable public @Nullable Class<?> getJaxbClass()
-
nextLinkDefinition
public abstract DataSearchResult<?> nextLinkDefinition(ItemPath path, ItemDefinition<?> itemDefinition, PrismContext prismContext) throws QueryException
Tries to find "next step" in the translation process for a given ItemPath.- Parameters:
path
- A path to be resolved. Always non-null and non-empty. Should produce at least one transition.itemDefinition
- Item definition for the item being sought. Needed only for "any" items.- Returns:
- - Normally it returns the search result containing next item definition (entity, collection, ...) in the chain and the unresolved remainder of the path. The transition may be empty ("self") e.g. for metadata or construction. - If the search was not successful, returns null.
- Throws:
QueryException
-
getDebugDumpClassName
protected abstract String getDebugDumpClassName()
-
getShortInfo
public String getShortInfo()
-
-