Class AbstractPathResolver
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
-
- org.eclipse.persistence.jpa.jpql.tools.resolver.AbstractPathResolver
-
- Direct Known Subclasses:
CollectionValuedFieldResolver
,StateFieldResolver
public abstract class AbstractPathResolver extends Resolver
ThisResolver
is responsible to resolve a single path of a path expression (state field path expression, singled valued object field, or a collection-valued path expression).- Version:
- 2.5
- See Also:
CollectionValuedFieldResolver
,StateFieldResolver
- Author:
- Pascal Filion
- Since:
- 2.3
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
path
The name of the path for which its type will be retrieved.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPathResolver(Resolver parent, java.lang.String path)
Creates a newAbstractPathResolver
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ITypeDeclaration
buildTypeDeclaration()
Resolves theITypeDeclaration
of the property handled by thisResolver
.IManagedType
getManagedType()
Returns theIManagedType
associated with the field handled by thisResolver
.IMapping
getMapping()
Returns theIMapping
for the wrapped field.java.lang.String
getPath()
Returns the single path represented by thisResolver
.protected abstract IManagedType
resolveManagedType(IMapping mapping)
Resolves this path'sIManagedType
by using the givenIMapping
.protected IMapping
resolveMapping()
Retrieves theIMapping
for the given property name.java.lang.String
toString()
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
addChild, buildType, checkParent, getChild, getParent, getParentManagedType, getParentMapping, getParentType, getParentTypeDeclaration, getProvider, getQuery, getType, getType, getType, getTypeDeclaration, getTypeHelper, getTypeRepository, isNullAllowed, setNullAllowed
-
-
-
-
Method Detail
-
buildTypeDeclaration
protected ITypeDeclaration buildTypeDeclaration()
Resolves theITypeDeclaration
of the property handled by thisResolver
.- Specified by:
buildTypeDeclaration
in classResolver
- Returns:
- Either the
ITypeDeclaration
that was resolved by thisResolver
or theITypeDeclaration
forIType.UNRESOLVABLE_TYPE
if it could not be resolved
-
getManagedType
public IManagedType getManagedType()
Returns theIManagedType
associated with the field handled by thisResolver
. If thisResolver
does not handle a field that has aIManagedType
, thennull
should be returned.For example: "
SELECT e FROM Employee e
", theResolver
for e would be returning theIManagedType
for Employee.- Overrides:
getManagedType
in classResolver
- Returns:
- Either the
IManagedType
, if it could be resolved;null
otherwise
-
getMapping
public final IMapping getMapping()
Returns theIMapping
for the wrapped field.- Overrides:
getMapping
in classResolver
- Returns:
- Either the
IMapping
ornull
if none exists
-
getPath
public final java.lang.String getPath()
Returns the single path represented by thisResolver
.- Returns:
- The single path represented by this
Resolver
-
resolveManagedType
protected abstract IManagedType resolveManagedType(IMapping mapping)
Resolves this path'sIManagedType
by using the givenIMapping
.- Parameters:
mapping
- TheIMapping
, which is nevernull
, is used to calculate theIManagedType
- Returns:
- The
IManagedType
for the givenIMapping
, if it has one;null
if the type is a primitive
-
resolveMapping
protected IMapping resolveMapping()
Retrieves theIMapping
for the given property name.- Returns:
- Either the
IMapping
ornull
if none exists
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-