public abstract class Resolver
extends java.lang.Object
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.
Modifier | Constructor and Description |
---|---|
protected |
Resolver(Resolver parent)
Creates a new
Resolver . |
Modifier and Type | Method and Description |
---|---|
void |
addChild(java.lang.String variableName,
Resolver resolver)
Caches the given
Resolver . |
protected IType |
buildType()
|
protected abstract ITypeDeclaration |
buildTypeDeclaration()
Resolves the
ITypeDeclaration of the property handled by this Resolver . |
protected void |
checkParent(Resolver parent) |
Resolver |
getChild(java.lang.String variableName)
Retrieves the child of this
Resolver that has the given variable name. |
IManagedType |
getManagedType()
Returns the
IManagedType associated with the field handled by this Resolver . |
IMapping |
getMapping()
Returns the
IMapping for the wrapped field. |
Resolver |
getParent()
Returns the parent of this
Resolver . |
IManagedType |
getParentManagedType()
Returns the managed type of the parent resolver.
|
IMapping |
getParentMapping()
Returns the
IMapping of the parent resolver. |
IType |
getParentType()
Returns the type of the parent resolver.
|
ITypeDeclaration |
getParentTypeDeclaration()
Returns the type declaration of the parent resolver.
|
IManagedTypeProvider |
getProvider()
Returns the provider of managed types.
|
IQuery |
getQuery()
Returns the external form representing the JPQL query.
|
IType |
getType()
|
IType |
getType(java.lang.Class<?> type)
Returns the
IType of the given Java type. |
IType |
getType(java.lang.String typeName)
Retrieves the external class for the given fully qualified class name.
|
ITypeDeclaration |
getTypeDeclaration()
Returns the
ITypeDeclaration of the field handled by this Resolver . |
TypeHelper |
getTypeHelper()
Returns a helper that gives access to the most common
types . |
ITypeRepository |
getTypeRepository()
Returns the type repository for the application.
|
boolean |
isNullAllowed()
Determines whether the
Expression
to be created, which wraps the attribute or query key name allows the target of the 1:1
relationship to be null if there is no corresponding relationship in the database. |
void |
setNullAllowed(boolean nullAllowed)
Sets whether the
Expression to be
created, which wraps the attribute or query key name allows the target of the 1:1 relationship
to be null if there is no corresponding relationship in the database. |
protected Resolver(Resolver parent)
Resolver
.parent
- The parent of this resolver, which is never null
java.lang.NullPointerException
- If the parent is null
public final void addChild(java.lang.String variableName, Resolver resolver)
Resolver
.protected IType buildType()
IType
that was resolved by this Resolver
or the IType
for IType.UNRESOLVABLE_TYPE
if it could not be resolvedprotected abstract ITypeDeclaration buildTypeDeclaration()
ITypeDeclaration
of the property handled by this Resolver
.ITypeDeclaration
that was resolved by this Resolver
or the
ITypeDeclaration
for IType.UNRESOLVABLE_TYPE
if it could not be resolvedprotected void checkParent(Resolver parent)
public final Resolver getChild(java.lang.String variableName)
Resolver
that has the given variable name.variableName
- The name of the property that was cachedResolver
mapped with the given property name; otherwise null
public IManagedType getManagedType()
IManagedType
associated with the field handled by this Resolver
.
If this Resolver
does not handle a field that has a IManagedType
, then
null
should be returned.
For example: "SELECT e FROM Employee e
", the Resolver
for
e would be returning the IManagedType
for Employee.
IManagedType
, if it could be resolved; null
otherwisepublic IMapping getMapping()
IMapping
for the wrapped field.IMapping
or null
if none existspublic Resolver getParent()
Resolver
.Resolver
public final IManagedType getParentManagedType()
public final IMapping getParentMapping()
IMapping
of the parent resolver.IMapping
of the parent resolverpublic final IType getParentType()
public final ITypeDeclaration getParentTypeDeclaration()
public final IManagedTypeProvider getProvider()
public IQuery getQuery()
public final IType getType()
IType
that was resolved by this Resolver
or the IType
for IType.UNRESOLVABLE_TYPE
if it could not be resolvedpublic final IType getType(java.lang.Class<?> type)
IType
of the given Java type.type
- The Java type for which its external form will be returnedIType
representing the given Java typepublic final IType getType(java.lang.String typeName)
typeName
- The fully qualified class name of the class to retrievepublic final ITypeDeclaration getTypeDeclaration()
ITypeDeclaration
of the field handled by this Resolver
.ITypeDeclaration
that was resolved by this Resolver
or the
ITypeDeclaration
for IType.UNRESOLVABLE_TYPE
if it could not be resolvedpublic final TypeHelper getTypeHelper()
types
.IType
public final ITypeRepository getTypeRepository()
ITypes
public boolean isNullAllowed()
Expression
to be created, which wraps the attribute or query key name allows the target of the 1:1
relationship to be null
if there is no corresponding relationship in the database.true
to allow null
if the corresponding relationship in the
database does not exists; false
otherwisepublic void setNullAllowed(boolean nullAllowed)
Expression
to be
created, which wraps the attribute or query key name allows the target of the 1:1 relationship
to be null
if there is no corresponding relationship in the database.nullAllowed
- true
to allow null
if the corresponding
relationship in the database does not exists; false
otherwise