Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.jpa.internal.jpql
Class Resolver

java.lang.Object
  extended by org.eclipse.persistence.jpa.internal.jpql.Resolver

Direct Known Subclasses:
AbsFunctionResolver, AbstractPathResolver, ClassNameResolver, ClassResolver, CollectionEquivalentResolver, DeclarationResolver, EntityResolver, FuncResolver, IdentificationVariableResolver, KeyResolver, NullResolver, NumericResolver, SumFunctionResolver, TreatResolver, ValueResolver

public abstract class Resolver
extends java.lang.Object

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.

Since:
2.3
Version:
2.3
Author:
Pascal Filion

Field 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.
private  Resolver parent
          The parent of this resolver, which is never null.
private  java.util.Map<java.lang.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
Resolver(Resolver parent)
          Creates a new Resolver.

 

Method Summary
abstract  void accept(ResolverVisitor visitor)
          Visits this Resolver by the given visitor.
(package private)  void addChild(java.lang.String variableName, Resolver resolver)
          Caches the given Resolver.
(package private)  IType buildType()
          Resolves the IType of the property handled by this Resolver.
(package private) abstract  ITypeDeclaration buildTypeDeclaration()
          Resolves the ITypeDeclaration of the property handled by this Resolver.
(package private)  void checkParent(Resolver parent)
           
(package private)  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.
(package private)  IManagedType getParentManagedType()
          Returns the managed type of the parent resolver.
(package private)  IMapping getParentMapping()
          Returns the IMapping of the parent resolver.
(package private)  IType getParentType()
          Returns the type of the parent resolver.
(package private)  ITypeDeclaration getParentTypeDeclaration()
          Returns the type declaration of the parent resolver.
(package private)  IManagedTypeProvider getProvider()
          Returns the provider of managed types.
(package private)  IQuery getQuery()
          Returns the external form representing the JPQL query.
 IType getType()
          Returns the IType of the field handled by this Resolver.
(package private)  IType getType(java.lang.Class<?> type)
          Returns the IType of the given Java type.
(package private)  IType getType(java.lang.String typeName)
          Retrieves the external class for the given fully qualified class name.
(package private)  ITypeDeclaration getTypeDeclaration()
          Returns the ITypeDeclaration of the field handled by this Resolver.
(package private)  TypeHelper getTypeHelper()
          Returns a helper that gives access to the most common types.
(package private)  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.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

nullAllowed

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.

parent

private final Resolver parent
The parent of this resolver, which is never null.

resolvers

private java.util.Map<java.lang.String,Resolver> resolvers
The cached Resolvers mapped with a variable name.

type

private IType type
The cached IType of the value to resolve.

typeDeclaration

private ITypeDeclaration typeDeclaration
The cached ITypeDeclaration of the value to resolve.

Constructor Detail

Resolver

Resolver(Resolver parent)
Creates a new Resolver.
Parameters:
parent - The parent of this resolver, which is never null
Throws:
java.lang.NullPointerException - If the parent is null

Method Detail

accept

public abstract void accept(ResolverVisitor visitor)
Visits this Resolver by the given visitor.
Parameters:
visitor - The visitor to visit this object

addChild

final void addChild(java.lang.String variableName,
                    Resolver resolver)
Caches the given Resolver.
Parameters:
variableName - The key used to cache the given Resolver
resolver - The Resolver to cache

buildType

IType buildType()
Resolves the IType of the property handled by this Resolver.
Returns:
Either the IType that was resolved by this Resolver or the IType for IType.UNRESOLVABLE_TYPE if it could not be resolved

buildTypeDeclaration

abstract ITypeDeclaration buildTypeDeclaration()
Resolves the ITypeDeclaration of the property handled by this Resolver.
Returns:
Either the ITypeDeclaration that was resolved by this Resolver or the ITypeDeclaration for IType.UNRESOLVABLE_TYPE if it could not be resolved

checkParent

void checkParent(Resolver parent)

getChild

final Resolver getChild(java.lang.String variableName)
Retrieves the child of this Resolver 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; otherwise null

getManagedType

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:
Either the IManagedType, if it could be resolved; null otherwise

getMapping

public IMapping getMapping()
Returns the IMapping for the wrapped field.
Returns:
Either the IMapping or null if none exists

getParent

public Resolver getParent()
Returns the parent of this Resolver.
Returns:
The parent of this Resolver

getParentManagedType

final IManagedType getParentManagedType()
Returns the managed type of the parent resolver.
Returns:
The managed type of the parent resolver

getParentMapping

final IMapping getParentMapping()
Returns the IMapping of the parent resolver.
Returns:
The IMapping of the parent resolver

getParentType

final IType getParentType()
Returns the type of the parent resolver.
Returns:
The type of the parent resolver

getParentTypeDeclaration

final ITypeDeclaration getParentTypeDeclaration()
Returns the type declaration of the parent resolver.
Returns:
The type declaration of the parent resolver

getProvider

final IManagedTypeProvider getProvider()
Returns the provider of managed types.
Returns:
The container holding the managed types

getQuery

IQuery getQuery()
Returns the external form representing the JPQL query.
Returns:
The external form of the JPQL query

getType

public final IType getType()
Returns the IType of the field handled by this Resolver.
Returns:
Either the IType that was resolved by this Resolver or the IType for IType.UNRESOLVABLE_TYPE if it could not be resolved

getType

final IType getType(java.lang.Class<?> type)
Returns the IType 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

final IType getType(java.lang.String typeName)
Retrieves the external class for the given fully qualified class name.
Parameters:
name - The fully qualified class name of the class to retrieve
Returns:
The external form of the class to retrieve

getTypeDeclaration

final ITypeDeclaration getTypeDeclaration()
Returns the ITypeDeclaration of the field handled by this Resolver.
Returns:
Either the ITypeDeclaration that was resolved by this Resolver or the ITypeDeclaration for IType.UNRESOLVABLE_TYPE if it could not be resolved

getTypeHelper

final TypeHelper getTypeHelper()
Returns a helper that gives access to the most common types.
Returns:
A helper containing a collection of methods related to IType

getTypeRepository

final ITypeRepository getTypeRepository()
Returns the type repository for the application.
Returns:
The repository of ITypes

isNullAllowed

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

setNullAllowed

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

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.