Class NavigablePath

java.lang.Object
org.hibernate.spi.NavigablePath
All Implemented Interfaces:
Serializable, DotIdentifierSequence
Direct Known Subclasses:
EntityIdentifierNavigablePath, TreatedNavigablePath

@Incubating public class NavigablePath extends Object implements DotIdentifierSequence, Serializable
A compound name where the root path element is an entity name or a collection role and each the path sub-path from the root references a domain or mapping model part relative to a root path.
See Also:
  • Field Details

  • Constructor Details

    • NavigablePath

      public NavigablePath(String localName)
    • NavigablePath

      public NavigablePath(String rootName, @Nullable String alias)
    • NavigablePath

      public NavigablePath(NavigablePath parent, String navigableName)
    • NavigablePath

      public NavigablePath(NavigablePath parent, String localName, @Nullable String alias)
    • NavigablePath

      public NavigablePath(@Nullable NavigablePath parent, String localName, @Nullable String alias, String identifierForTableGroup, int hashCode)
  • Method Details

    • getParent

      public @Nullable NavigablePath getParent()
      Description copied from interface: DotIdentifierSequence
      The parent sequence part.

      Given the sequence a.b.c, returns the sequence a.b.

      Specified by:
      getParent in interface DotIdentifierSequence
    • getLocalName

      public String getLocalName()
      Description copied from interface: DotIdentifierSequence
      The name of this leaf sequence part.

      Given the sequence a.b.c, returns the string "c".

      Specified by:
      getLocalName in interface DotIdentifierSequence
    • getAlias

      public @Nullable String getAlias()
    • isAliased

      public boolean isAliased()
    • getIdentifierForTableGroup

      public String getIdentifierForTableGroup()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object
    • localNamesMatch

      protected boolean localNamesMatch(DotIdentifierSequence other)
    • localNamesMatch

      protected boolean localNamesMatch(EntityIdentifierNavigablePath other)
    • append

      public NavigablePath append(String property)
      Description copied from interface: DotIdentifierSequence
      Append a new part to the end of this sequence, returning the new representation.

      Given the sequence a.b.c, appending d results in the new sequence a.b.c.d.

      Specified by:
      append in interface DotIdentifierSequence
    • append

      public NavigablePath append(String property, @Nullable String alias)
    • treatAs

      public NavigablePath treatAs(String entityName)
    • treatAs

      public NavigablePath treatAs(String entityName, @Nullable String alias)
    • getRealParent

      public @Nullable NavigablePath getRealParent()
    • isParent

      public boolean isParent(@Nullable NavigablePath navigablePath)
      Determine whether this path is part of the given path's parent
    • isSuffix

      public boolean isSuffix(@Nullable DotIdentifierSequence dotIdentifierSequence)
      Determine whether the given path is a suffix of this path
    • trimSuffix

      public @Nullable NavigablePath trimSuffix(@Nullable DotIdentifierSequence suffix)
      Removes the suffix part from the NavigablePath, when the NavigablePath does not contain the suffix it returns null;
      Parameters:
      suffix - the part to remove from the NavigablePath
      Returns:
      the NavigablePath stripped of the suffix part or null if the NavigablePath does not contain the suffix.
    • isParentOrEqual

      public boolean isParentOrEqual(@Nullable NavigablePath navigablePath)
      Determine whether this path is part of the given path's parent
    • pathsMatch

      public boolean pathsMatch(@Nullable NavigablePath path)
    • relativize

      public @Nullable String relativize(NavigablePath base)
      Ignores aliases in the resulting String
    • relativize

      protected void relativize(NavigablePath base, NavigablePath.RelativePathCollector collector)
    • getFullPath

      public String getFullPath()
      Description copied from interface: DotIdentifierSequence
      The full sequence text.

      Given the sequence a.b.c, returns the string "a.b.c".

      Specified by:
      getFullPath in interface DotIdentifierSequence
    • toString

      public String toString()
      Overrides:
      toString in class Object