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
ThisResolveris 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.StringpathThe name of the path for which its type will be retrieved.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPathResolver(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 ITypeDeclarationbuildTypeDeclaration()Resolves theITypeDeclarationof the property handled by thisResolver.IManagedTypegetManagedType()Returns theIManagedTypeassociated with the field handled by thisResolver.IMappinggetMapping()Returns theIMappingfor the wrapped field.java.lang.StringgetPath()Returns the single path represented by thisResolver.protected abstract IManagedTyperesolveManagedType(IMapping mapping)Resolves this path'sIManagedTypeby using the givenIMapping.protected IMappingresolveMapping()Retrieves theIMappingfor the given property name.java.lang.StringtoString()-
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 theITypeDeclarationof the property handled by thisResolver.- Specified by:
buildTypeDeclarationin classResolver- Returns:
- Either the
ITypeDeclarationthat was resolved by thisResolveror theITypeDeclarationforIType.UNRESOLVABLE_TYPEif it could not be resolved
-
getManagedType
public IManagedType getManagedType()
Returns theIManagedTypeassociated with the field handled by thisResolver. If thisResolverdoes not handle a field that has aIManagedType, thennullshould be returned.For example: "
SELECT e FROM Employee e", theResolverfor e would be returning theIManagedTypefor Employee.- Overrides:
getManagedTypein classResolver- Returns:
- Either the
IManagedType, if it could be resolved;nullotherwise
-
getMapping
public final IMapping getMapping()
Returns theIMappingfor the wrapped field.- Overrides:
getMappingin classResolver- Returns:
- Either the
IMappingornullif 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'sIManagedTypeby using the givenIMapping.- Parameters:
mapping- TheIMapping, which is nevernull, is used to calculate theIManagedType- Returns:
- The
IManagedTypefor the givenIMapping, if it has one;nullif the type is a primitive
-
resolveMapping
protected IMapping resolveMapping()
Retrieves theIMappingfor the given property name.- Returns:
- Either the
IMappingornullif none exists
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-