Class JpaDataNodeDefinition<T extends 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)

    • Constructor Detail

      • JpaDataNodeDefinition

        public JpaDataNodeDefinition​(@NotNull
                                     @NotNull Class<?> jpaClass,
                                     @Nullable Class<?> jaxbClass)
    • Method Detail

      • getJpaClass

        public @NotNull Class<?> getJpaClass()
      • getJpaClassName

        public String getJpaClassName()
      • getJaxbClass

        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.
        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.
        - 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.
      • getDebugDumpClassName

        protected abstract String getDebugDumpClassName()
      • getShortInfo

        public String getShortInfo()