Top Description Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.tools.resolver

public abstract Class Resolver

extends Object
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.resolver.SubqueryEntityResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.SumFunctionResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.TreatResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.ValueResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.FromSubqueryResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.AbsFunctionResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.AbstractPathResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.ClassNameResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.ClassResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.CollectionEquivalentResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.DeclarationResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.EntityResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.EnumLiteralResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.IdentificationVariableResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.KeyResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.MathFunctionResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.NullResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.NumericResolver
Annotations
@SuppressWarnings:nls
Imports
java.util.HashMap, .Map, org.eclipse.persistence.jpa.jpql.tools.TypeHelper, org.eclipse.persistence.jpa.jpql.tools.spi.IManagedType, .IManagedTypeProvider, .IMapping, .IQuery, .IType, .ITypeDeclaration, .ITypeRepository

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.

Author
Pascal Filion
Since
2.3
Version
2.5

Field Summary

Modifier and TypeField and Description
private boolean
nullAllowed

This is only applicable to 1:1 relationships, and allows the target of the relationship to be null if there is no corresponding relationship in the database.

private final Resolver
parent

The parent of this resolver, which is never null.

private Map<String, Resolver>
resolvers

The cached Resolvers mapped with a variable name.

private IType
type

The cached IType of the value to resolve.

private ITypeDeclaration
typeDeclaration

The cached ITypeDeclaration of the value to resolve.

Constructor Summary

AccessConstructor and Description
protected
Resolver(Resolver
The parent of this resolver, which is never null
parent
)

Creates a new Resolver.

Method Summary

Modifier and TypeMethod and Description
public final void
addChild(String
The key used to cache the given Resolver
variableName
,
Resolver
The Resolver to cache
resolver
)

Caches the given Resolver.

protected IType

Returns:

Either the IType that was resolved by this Resolver or the IType for IType#UNRESOLVABLE_TYPE if it could not be resolved
buildType
()

Resolves the IType of the property handled by this Resolver.

protected abstract ITypeDeclaration

Returns:

Either the ITypeDeclaration that was resolved by this Resolver or the ITypeDeclaration for IType#UNRESOLVABLE_TYPE if it could not be resolved
buildTypeDeclaration
()

Resolves the ITypeDeclaration of the property handled by this Resolver.

protected void
public final Resolver

Returns:

The cached Resolver mapped with the given property name; otherwise null
getChild
(String
The name of the property that was cached
variableName
)

Retrieves the child of this Resolver that has the given variable name.

public IManagedType

Returns:

Either the IManagedType, if it could be resolved; null otherwise
getManagedType
()

Returns the IManagedType associated with the field handled by this Resolver.

public IMapping

Returns:

Either the IMapping or null if none exists
getMapping
()

Returns the IMapping for the wrapped field.

public Resolver

Returns:

The parent of this Resolver
getParent
()

Returns the parent of this Resolver.

public final IManagedType

Returns:

The managed type of the parent resolver
getParentManagedType
()

Returns the managed type of the parent resolver.

public final IMapping

Returns:

The IMapping of the parent resolver
getParentMapping
()

Returns the IMapping of the parent resolver.

public final IType

Returns:

The type of the parent resolver
getParentType
()

Returns the type of the parent resolver.

public final ITypeDeclaration

Returns:

The type declaration of the parent resolver
getParentTypeDeclaration
()

Returns the type declaration of the parent resolver.

public final IManagedTypeProvider

Returns:

The container holding the managed types
getProvider
()

Returns the provider of managed types.

public IQuery

Returns:

The external form of the JPQL query
getQuery
()

Returns the external form representing the JPQL query.

public final IType

Returns:

Either the IType that was resolved by this Resolver or the IType for IType#UNRESOLVABLE_TYPE if it could not be resolved
getType
()

Returns the IType of the field handled by this Resolver.

public final IType

Returns:

The IType representing the given Java type
getType
(Class<?>
The Java type for which its external form will be returned
type
)

Returns the IType of the given Java type.

public final IType

Returns:

The external form of the class to retrieve
getType
(String
The fully qualified class name of the class to retrieve
typeName
)

Retrieves the external class for the given fully qualified class name.

public final ITypeDeclaration

Returns:

Either the ITypeDeclaration that was resolved by this Resolver or the ITypeDeclaration for IType#UNRESOLVABLE_TYPE if it could not be resolved
getTypeDeclaration
()

Returns the ITypeDeclaration of the field handled by this Resolver.

public final TypeHelper

Returns:

A helper containing a collection of methods related to IType
getTypeHelper
()

Returns a helper that gives access to the most common types.

public final ITypeRepository

Returns:

The repository of ITypes
getTypeRepository
()

Returns the type repository for the application.

public boolean

Returns:

true to allow null if the corresponding relationship in the database does not exists; false otherwise
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.

public void
setNullAllowed(boolean
true to allow null if the corresponding relationship in the database does not exists; false otherwise
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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nullAllowedback to summary
private boolean nullAllowed

This is only applicable to 1:1 relationships, and allows the target of the relationship to be null if there is no corresponding relationship in the database.

parentback to summary
private final Resolver parent

The parent of this resolver, which is never null.

resolversback to summary
private Map<String, Resolver> resolvers

The cached Resolvers mapped with a variable name.

typeback to summary
private IType type

The cached IType of the value to resolve.

typeDeclarationback to summary
private ITypeDeclaration typeDeclaration

The cached ITypeDeclaration of the value to resolve.

Constructor Detail

Resolverback to summary
protected Resolver(Resolver parent)

Creates a new Resolver.

Parameters
parent:Resolver

The parent of this resolver, which is never null

Exceptions
NullPointerException:
If the parent is null

Method Detail

addChildback to summary
public final void addChild(String variableName, Resolver resolver)

Caches the given Resolver.

Parameters
variableName:String

The key used to cache the given Resolver

resolver:Resolver

The Resolver to cache

buildTypeback to summary
protected IType buildType()

Resolves the IType of the property handled by this Resolver.

Returns:IType

Either the IType that was resolved by this Resolver or the IType for IType#UNRESOLVABLE_TYPE if it could not be resolved

buildTypeDeclarationback to summary
protected abstract ITypeDeclaration buildTypeDeclaration()

Resolves the ITypeDeclaration of the property handled by this Resolver.

Returns:ITypeDeclaration

Either the ITypeDeclaration that was resolved by this Resolver or the ITypeDeclaration for IType#UNRESOLVABLE_TYPE if it could not be resolved

checkParentback to summary
protected void checkParent(Resolver parent)
getChildback to summary
public final Resolver getChild(String variableName)

Retrieves the child of this Resolver that has the given variable name.

Parameters
variableName:String

The name of the property that was cached

Returns:Resolver

The cached Resolver mapped with the given property name; otherwise null

getManagedTypeback to summary
public IManagedType getManagedType()

Returns the 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.

Returns:IManagedType

Either the IManagedType, if it could be resolved; null otherwise

getMappingback to summary
public IMapping getMapping()

Returns the IMapping for the wrapped field.

Returns:IMapping

Either the IMapping or null if none exists

getParentback to summary
public Resolver getParent()

Returns the parent of this Resolver.

Returns:Resolver

The parent of this Resolver

getParentManagedTypeback to summary
public final IManagedType getParentManagedType()

Returns the managed type of the parent resolver.

Returns:IManagedType

The managed type of the parent resolver

getParentMappingback to summary
public final IMapping getParentMapping()

Returns the IMapping of the parent resolver.

Returns:IMapping

The IMapping of the parent resolver

getParentTypeback to summary
public final IType getParentType()

Returns the type of the parent resolver.

Returns:IType

The type of the parent resolver

getParentTypeDeclarationback to summary
public final ITypeDeclaration getParentTypeDeclaration()

Returns the type declaration of the parent resolver.

Returns:ITypeDeclaration

The type declaration of the parent resolver

getProviderback to summary
public final IManagedTypeProvider getProvider()

Returns the provider of managed types.

Returns:IManagedTypeProvider

The container holding the managed types

getQueryback to summary
public IQuery getQuery()

Returns the external form representing the JPQL query.

Returns:IQuery

The external form of the JPQL query

getTypeback to summary
public final IType getType()

Returns the IType of the field handled by this Resolver.

Returns:IType

Either the IType that was resolved by this Resolver or the IType for IType#UNRESOLVABLE_TYPE if it could not be resolved

getTypeback to summary
public final IType getType(Class<?> type)

Returns the IType of the given Java type.

Parameters
type:Class<?>

The Java type for which its external form will be returned

Returns:IType

The IType representing the given Java type

getTypeback to summary
public final IType getType(String typeName)

Retrieves the external class for the given fully qualified class name.

Parameters
typeName:String

The fully qualified class name of the class to retrieve

Returns:IType

The external form of the class to retrieve

getTypeDeclarationback to summary
public final ITypeDeclaration getTypeDeclaration()

Returns the ITypeDeclaration of the field handled by this Resolver.

Returns:ITypeDeclaration

Either the ITypeDeclaration that was resolved by this Resolver or the ITypeDeclaration for IType#UNRESOLVABLE_TYPE if it could not be resolved

getTypeHelperback to summary
public final TypeHelper getTypeHelper()

Returns a helper that gives access to the most common types.

Returns:TypeHelper

A helper containing a collection of methods related to IType

getTypeRepositoryback to summary
public final ITypeRepository getTypeRepository()

Returns the type repository for the application.

Returns:ITypeRepository

The repository of ITypes

isNullAllowedback to summary
public 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.

Returns:boolean

true to allow null if the corresponding relationship in the database does not exists; false otherwise

setNullAllowedback to summary
public 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.

Parameters
nullAllowed:boolean

true to allow null if the corresponding relationship in the database does not exists; false otherwise