Package org.hibernate.spi
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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
NavigablePath.FullPathCalculator
Effectively a tri-functionprotected static class
NavigablePath.RelativePathCollector
-
Field Summary
Fields Modifier and Type Field Description static String
IDENTIFIER_MAPPER_PROPERTY
-
Constructor Summary
Constructors Constructor Description NavigablePath(@Nullable NavigablePath parent, String localName, @Nullable String alias, String identifierForTableGroup, NavigablePath.FullPathCalculator fullPathCalculator, int hashCode)
NavigablePath(String localName)
NavigablePath(String rootName, @Nullable String alias)
NavigablePath(NavigablePath parent, String navigableName)
NavigablePath(NavigablePath parent, String localName, @Nullable String alias)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NavigablePath
append(String property)
Append a new part to the end of this sequence, returning the new representation.NavigablePath
append(String property, String alias)
protected static String
calculateIdMapperFullPath(@Nullable NavigablePath parent, String localName, @Nullable String alias)
Pattern used for `_identifierMapper`protected static String
calculateRootFullPath(@Nullable NavigablePath parent, String rootName, @Nullable String alias)
The pattern used for root NavigablePathsboolean
equals(@Nullable Object other)
@Nullable String
getAlias()
String
getFullPath()
The full sequence text.String
getIdentifierForTableGroup()
String
getLocalName()
The name of this leaf sequence part.@Nullable NavigablePath
getParent()
The parent sequence part.@Nullable NavigablePath
getRealParent()
int
hashCode()
boolean
isAliased()
boolean
isParent(@Nullable NavigablePath navigablePath)
Determine whether this path is part of the given path's parentboolean
isParentOrEqual(@Nullable NavigablePath navigablePath)
Determine whether this path is part of the given path's parentboolean
isSuffix(@Nullable DotIdentifierSequence dotIdentifierSequence)
Determine whether the given path is a suffix of this pathprotected boolean
localNamesMatch(DotIdentifierSequence other)
protected boolean
localNamesMatch(EntityIdentifierNavigablePath other)
boolean
pathsMatch(@Nullable NavigablePath p)
@Nullable String
relativize(NavigablePath base)
Ignores aliases in the resulting Stringprotected void
relativize(NavigablePath base, NavigablePath.RelativePathCollector collector)
String
toString()
NavigablePath
treatAs(String entityName)
NavigablePath
treatAs(String entityName, String alias)
@Nullable NavigablePath
trimSuffix(@Nullable DotIdentifierSequence suffix)
Removes the suffix part from the NavigablePath, when the NavigablePath does not contain the suffix it returns null;-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.spi.DotIdentifierSequence
getParts, isRoot
-
-
-
-
Field Detail
-
IDENTIFIER_MAPPER_PROPERTY
public static final String IDENTIFIER_MAPPER_PROPERTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NavigablePath
public NavigablePath(String localName)
-
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, NavigablePath.FullPathCalculator fullPathCalculator, int hashCode)
-
-
Method Detail
-
getParent
public @Nullable NavigablePath getParent()
Description copied from interface:DotIdentifierSequence
The parent sequence part.Given the sequence
a.b.c
, returns the sequencea.b
.- Specified by:
getParent
in interfaceDotIdentifierSequence
-
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 interfaceDotIdentifierSequence
-
getAlias
public @Nullable String getAlias()
-
isAliased
public boolean isAliased()
-
getIdentifierForTableGroup
public String getIdentifierForTableGroup()
-
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
, appendingd
results in the new sequencea.b.c.d
.- Specified by:
append
in interfaceDotIdentifierSequence
-
append
public NavigablePath append(String property, String alias)
-
treatAs
public NavigablePath treatAs(String entityName)
-
treatAs
public NavigablePath treatAs(String entityName, 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 p)
-
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 interfaceDotIdentifierSequence
-
calculateRootFullPath
protected static String calculateRootFullPath(@Nullable NavigablePath parent, String rootName, @Nullable String alias)
The pattern used for root NavigablePaths
-
calculateIdMapperFullPath
protected static String calculateIdMapperFullPath(@Nullable NavigablePath parent, String localName, @Nullable String alias)
Pattern used for `_identifierMapper`
-
-