Top Description Inners Fields Constructors Methods
org.hibernate.spi

public Class NavigablePath

extends Object
implements DotIdentifierSequence, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.hibernate.spi.DotIdentifierSequence
Known Direct Subclasses
org.hibernate.spi.TreatedNavigablePath, org.hibernate.spi.EntityIdentifierNavigablePath
Annotations
@Incubating
Imports
java.io.Serializable, java.util.Objects, org.hibernate.Incubating, org.hibernate.internal.util.StringHelper, org.checkerframework.checker.nullness.qual.Nullable

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.
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static interface
NavigablePath.FullPathCalculator

Effectively a tri-function

protected static class

Field Summary

Modifier and TypeField and Description
private final @Nullable String
private final NavigablePath.FullPathCalculator
private final int
public static final String
private final String
private final String
private final @Nullable NavigablePath

Constructor Summary

AccessConstructor and Description

Method Summary

Modifier and TypeMethod and Description
public NavigablePath
append(String property)

Implements org.hibernate.spi.DotIdentifierSequence.append.

Append a new part to the end of this sequence, returning the new representation.
public NavigablePath
append(String property, String alias)

protected static String
calculateIdMapperFullPath(@Nullable NavigablePath parent, String localName, @Nullable String alias)

Pattern used for `_identifierMapper`

private static String
calculateNormalFullPath(@Nullable NavigablePath parent, String localName, @Nullable String alias)

The normal pattern used for the "full path"

protected static String
calculateRootFullPath(@Nullable NavigablePath parent, String rootName, @Nullable String alias)

The pattern used for root NavigablePaths

public boolean
equals(@Nullable Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public @Nullable String
public String
public String
public String
getLocalName()

Implements org.hibernate.spi.DotIdentifierSequence.getLocalName.

The name of this leaf sequence part.
public @Nullable NavigablePath
getParent()

Implements org.hibernate.spi.DotIdentifierSequence.getParent.

The parent sequence part.
public @Nullable NavigablePath
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
public boolean
isParent(@Nullable NavigablePath navigablePath)

Determine whether this path is part of the given path's parent

public boolean
isParentOrEqual(@Nullable NavigablePath navigablePath)

Determine whether this path is part of the given path's parent

public boolean
isSuffix(@Nullable DotIdentifierSequence dotIdentifierSequence)

Determine whether the given path is a suffix of this path

protected boolean
protected boolean
public boolean
public @Nullable String
relativize(NavigablePath base)

Ignores aliases in the resulting String

protected void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public NavigablePath
treatAs(String entityName)

public NavigablePath
treatAs(String entityName, String alias)

public @Nullable NavigablePath

Returns:

the NavigablePath stripped of the suffix part or null if the NavigablePath does not contain the suffix.
trimSuffix
(@Nullable DotIdentifierSequence
the part to remove from the NavigablePath
suffix
)

Removes the suffix part from the NavigablePath, when the NavigablePath does not contain the suffix it returns null;

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

aliasback to summary
private final @Nullable String alias
fullPathCalculatorback to summary
private final NavigablePath.FullPathCalculator fullPathCalculator
hashCodeback to summary
private final int hashCode
IDENTIFIER_MAPPER_PROPERTYback to summary
public static final String IDENTIFIER_MAPPER_PROPERTY
identifierForTableGroupback to summary
private final String identifierForTableGroup
localNameback to summary
private final String localName
parentback to summary
private final @Nullable NavigablePath parent

Constructor Detail

Method Detail

appendback to summary
public NavigablePath append(String property)

Implements org.hibernate.spi.DotIdentifierSequence.append.

Doc from org.hibernate.spi.DotIdentifierSequence.append.

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.

appendback to summary
public NavigablePath append(String property, String alias)
calculateIdMapperFullPathback to summary
protected static String calculateIdMapperFullPath(@Nullable NavigablePath parent, String localName, @Nullable String alias)

Pattern used for `_identifierMapper`

calculateNormalFullPathback to summary
private static String calculateNormalFullPath(@Nullable NavigablePath parent, String localName, @Nullable String alias)

The normal pattern used for the "full path"

calculateRootFullPathback to summary
protected static String calculateRootFullPath(@Nullable NavigablePath parent, String rootName, @Nullable String alias)

The pattern used for root NavigablePaths

equalsback to summary
public boolean equals(@Nullable Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:@Nullable Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAliasback to summary
public @Nullable String getAlias()
getFullPathback to summary
public String getFullPath()

Implements org.hibernate.spi.DotIdentifierSequence.getFullPath.

Doc from org.hibernate.spi.DotIdentifierSequence.getFullPath.

The full sequence text.

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

Annotations
@Override
getIdentifierForTableGroupback to summary
public String getIdentifierForTableGroup()
getLocalNameback to summary
public String getLocalName()

Implements org.hibernate.spi.DotIdentifierSequence.getLocalName.

Doc from org.hibernate.spi.DotIdentifierSequence.getLocalName.

The name of this leaf sequence part.

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

Annotations
@Override
getParentback to summary
public @Nullable NavigablePath getParent()

Implements org.hibernate.spi.DotIdentifierSequence.getParent.

Doc from org.hibernate.spi.DotIdentifierSequence.getParent.

The parent sequence part.

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

Annotations
@Override
getRealParentback to summary
public @Nullable NavigablePath getRealParent()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isAliasedback to summary
public boolean isAliased()
isParentback to summary
public boolean isParent(@Nullable NavigablePath navigablePath)

Determine whether this path is part of the given path's parent

isParentOrEqualback to summary
public boolean isParentOrEqual(@Nullable NavigablePath navigablePath)

Determine whether this path is part of the given path's parent

isSuffixback to summary
public boolean isSuffix(@Nullable DotIdentifierSequence dotIdentifierSequence)

Determine whether the given path is a suffix of this path

localNamesMatchback to summary
protected boolean localNamesMatch(DotIdentifierSequence other)
localNamesMatchback to summary
protected boolean localNamesMatch(EntityIdentifierNavigablePath other)
pathsMatchback to summary
public boolean pathsMatch(@Nullable NavigablePath p)
relativizeback to summary
public @Nullable String relativize(NavigablePath base)

Ignores aliases in the resulting String

relativizeback to summary
protected void relativize(NavigablePath base, NavigablePath.RelativePathCollector collector)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
treatAsback to summary
public NavigablePath treatAs(String entityName)
treatAsback to summary
public NavigablePath treatAs(String entityName, String alias)
trimSuffixback to summary
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:@Nullable DotIdentifierSequence

the part to remove from the NavigablePath

Returns:@Nullable NavigablePath

the NavigablePath stripped of the suffix part or null if the NavigablePath does not contain the suffix.

org.hibernate.spi back to summary

protected Interface NavigablePath.FullPathCalculator

extends Serializable
Annotations
@FunctionalInterface

Effectively a tri-function

Method Summary

Modifier and TypeMethod and Description
public String

Method Detail

calculateFullPathback to summary
public String calculateFullPath(@Nullable NavigablePath parent, String localName, @Nullable String alias)
org.hibernate.spi back to summary

protected Class NavigablePath.RelativePathCollector

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private StringBuilder
private boolean

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
public @Nullable String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
private StringBuilder buffer
matchedBaseback to summary
private boolean matchedBase

Constructor Detail

RelativePathCollectorback to summary
protected RelativePathCollector()

Method Detail

collectPathback to summary
public void collectPath(String path)
resolveback to summary
public @Nullable String resolve()