Class Resolver
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
- Direct Known Subclasses:
AbsFunctionResolver
,AbstractPathResolver
,ClassNameResolver
,ClassResolver
,CollectionEquivalentResolver
,DeclarationResolver
,EntityResolver
,EnumLiteralResolver
,FromSubqueryResolver
,IdentificationVariableResolver
,KeyResolver
,MathFunctionResolver
,NullResolver
,NumericResolver
,SubqueryEntityResolver
,SumFunctionResolver
,TreatResolver
,ValueResolver
A
Resolver
is responsible to resolve a property by retrieving either the managed
type, the mapping, the type and the type declaration depending on the type of resolver.
Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
- Since:
- 2.3
- Version:
- 2.5
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Caches the givenResolver
.protected IType
protected abstract ITypeDeclaration
Resolves theITypeDeclaration
of the property handled by thisResolver
.protected void
checkParent
(Resolver parent) final Resolver
Retrieves the child of thisResolver
that has the given variable name.Returns theIManagedType
associated with the field handled by thisResolver
.Returns theIMapping
for the wrapped field.Returns the parent of thisResolver
.final IManagedType
Returns the managed type of the parent resolver.final IMapping
Returns theIMapping
of the parent resolver.final IType
Returns the type of the parent resolver.final ITypeDeclaration
Returns the type declaration of the parent resolver.final IManagedTypeProvider
Returns the provider of managed types.getQuery()
Returns the external form representing the JPQL query.final IType
getType()
final IType
Returns theIType
of the given Java type.final IType
Retrieves the external class for the given fully qualified class name.final ITypeDeclaration
Returns theITypeDeclaration
of the field handled by thisResolver
.final TypeHelper
Returns a helper that gives access to the most commontypes
.final ITypeRepository
Returns the type repository for the application.boolean
Determines whether theExpression
to be created, which wraps the attribute or query key name allows the target of the 1:1 relationship to benull
if there is no corresponding relationship in the database.void
setNullAllowed
(boolean nullAllowed) Sets whether theExpression
to be created, which wraps the attribute or query key name allows the target of the 1:1 relationship to benull
if there is no corresponding relationship in the database.
-
Constructor Details
-
Resolver
Creates a newResolver
.- Parameters:
parent
- The parent of this resolver, which is nevernull
- Throws:
NullPointerException
- If the parent isnull
-
-
Method Details
-
addChild
Caches the givenResolver
. -
buildType
- Returns:
- Either the
IType
that was resolved by thisResolver
or theIType
forIType.UNRESOLVABLE_TYPE
if it could not be resolved
-
buildTypeDeclaration
Resolves theITypeDeclaration
of the property handled by thisResolver
.- Returns:
- Either the
ITypeDeclaration
that was resolved by thisResolver
or theITypeDeclaration
forIType.UNRESOLVABLE_TYPE
if it could not be resolved
-
checkParent
-
getChild
Retrieves the child of thisResolver
that has the given variable name.- Parameters:
variableName
- The name of the property that was cached- Returns:
- The cached
Resolver
mapped with the given property name; otherwisenull
-
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.- Returns:
- Either the
IManagedType
, if it could be resolved;null
otherwise
-
getMapping
Returns theIMapping
for the wrapped field.- Returns:
- Either the
IMapping
ornull
if none exists
-
getParent
Returns the parent of thisResolver
.- Returns:
- The parent of this
Resolver
-
getParentManagedType
Returns the managed type of the parent resolver.- Returns:
- The managed type of the parent resolver
-
getParentMapping
Returns theIMapping
of the parent resolver.- Returns:
- The
IMapping
of the parent resolver
-
getParentType
Returns the type of the parent resolver.- Returns:
- The type of the parent resolver
-
getParentTypeDeclaration
Returns the type declaration of the parent resolver.- Returns:
- The type declaration of the parent resolver
-
getProvider
Returns the provider of managed types.- Returns:
- The container holding the managed types
-
getQuery
Returns the external form representing the JPQL query.- Returns:
- The external form of the JPQL query
-
getType
- Returns:
- Either the
IType
that was resolved by thisResolver
or theIType
forIType.UNRESOLVABLE_TYPE
if it could not be resolved
-
getType
Returns theIType
of the given Java type.- Parameters:
type
- The Java type for which its external form will be returned- Returns:
- The
IType
representing the given Java type
-
getType
Retrieves the external class for the given fully qualified class name.- Parameters:
typeName
- The fully qualified class name of the class to retrieve- Returns:
- The external form of the class to retrieve
-
getTypeDeclaration
Returns theITypeDeclaration
of the field handled by thisResolver
.- Returns:
- Either the
ITypeDeclaration
that was resolved by thisResolver
or theITypeDeclaration
forIType.UNRESOLVABLE_TYPE
if it could not be resolved
-
getTypeHelper
Returns a helper that gives access to the most commontypes
.- Returns:
- A helper containing a collection of methods related to
IType
-
getTypeRepository
Returns the type repository for the application.- Returns:
- The repository of
ITypes
-
isNullAllowed
public boolean isNullAllowed()Determines whether theExpression
to be created, which wraps the attribute or query key name allows the target of the 1:1 relationship to benull
if there is no corresponding relationship in the database.- Returns:
true
to allownull
if the corresponding relationship in the database does not exists;false
otherwise
-
setNullAllowed
public void setNullAllowed(boolean nullAllowed) Sets whether theExpression
to be created, which wraps the attribute or query key name allows the target of the 1:1 relationship to benull
if there is no corresponding relationship in the database.- Parameters:
nullAllowed
-true
to allownull
if the corresponding relationship in the database does not exists;false
otherwise
-