Class JpaDataNodeDefinition

  • All Implemented Interfaces:
    Visitable, DebugDumpable
    Direct Known Subclasses:
    JpaAnyContainerDefinition, JpaEntityDefinition, JpaEntityPointerDefinition, JpaPropertyDefinition, JpaReferenceDefinition

    public abstract class JpaDataNodeDefinition
    extends Object
    implements DebugDumpable, Visitable
    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)
    Author:
    mederly
    • Constructor Detail

      • JpaDataNodeDefinition

        public JpaDataNodeDefinition​(@NotNull
                                     @NotNull Class jpaClass,
                                     @Nullable
                                     @Nullable Class jaxbClass)
    • 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()