EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql
Class SubqueryEntityResolver

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

public class SubqueryEntityResolver
extends Resolver

This Resolver retrieves the type for an abstract schema name (entity name) if it can be resolved otherwise a derived path will be assumed. This Resolver is used within a subquery and it handles the following two cases.

The "root" object in the subquery is an unqualified derived path:

 UPDATE Employee SET name = 'JPQL'
 WHERE (SELECT a FROM addr a)
and The "root" object in the subquery is an entity:
 UPDATE Employee SET name = 'JPQL'
 WHERE (SELECT a FROM Address a)

Version:
2.5
Author:
Pascal Filion
Since:
2.5

Constructor Summary
SubqueryEntityResolver(Resolver parent, JPQLQueryContext queryContext, AbstractSchemaName abstractSchemaName)
          Creates a new DerivedPathResolver.
 
Method Summary
 void accept(ResolverVisitor visitor)
          Visits this Resolver by the given visitor.
protected  IType buildType()
          Resolves the IType of the property handled by this Resolver.
protected  ITypeDeclaration buildTypeDeclaration()
          Resolves the ITypeDeclaration of the property handled by this Resolver.
 java.lang.String getAbstractSchemaName()
          Returns the name of the entity to resolve.
 IManagedType getManagedType()
          Returns the IManagedType associated with the field handled by this Resolver.
 IMapping getMapping()
          Returns the IMapping for the wrapped field.
protected  Resolver resolveDerivePathResolver()
          Creates the Resolver for a unqualified derived path expression.
 java.lang.String toString()
          
 
Methods inherited from class org.eclipse.persistence.jpa.jpql.Resolver
addChild, checkParent, getChild, getParent, getParentManagedType, getParentMapping, getParentType, getParentTypeDeclaration, getProvider, getQuery, getType, getType, getType, getTypeDeclaration, getTypeHelper, getTypeRepository, isNullAllowed, setNullAllowed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubqueryEntityResolver

public SubqueryEntityResolver(Resolver parent,
                              JPQLQueryContext queryContext,
                              AbstractSchemaName abstractSchemaName)
Creates a new DerivedPathResolver.

Parameters:
parent - The parent Resolver, which is never null
queryContext - The JPQLQueryContext for the subquery
The - AbstractSchemaName holding onto the the name of the entity
Method Detail

accept

public void accept(ResolverVisitor visitor)
Visits this Resolver by the given visitor.

Specified by:
accept in class Resolver
Parameters:
visitor - The visitor to visit this object

buildType

protected IType buildType()
Resolves the IType of the property handled by this Resolver.

Overrides:
buildType in class 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

protected ITypeDeclaration buildTypeDeclaration()
Resolves the ITypeDeclaration of the property handled by this Resolver.

Specified by:
buildTypeDeclaration in class Resolver
Returns:
Either the ITypeDeclaration that was resolved by this Resolver or the ITypeDeclaration for IType.UNRESOLVABLE_TYPE if it could not be resolved

getAbstractSchemaName

public java.lang.String getAbstractSchemaName()
Returns the name of the entity to resolve.

Returns:
The entity name, which is never 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.

Overrides:
getManagedType in class Resolver
Returns:
Either the IManagedType, if it could be resolved; null otherwise

getMapping

public IMapping getMapping()
Returns the IMapping for the wrapped field.

Overrides:
getMapping in class Resolver
Returns:
Either the IMapping or null if none exists

resolveDerivePathResolver

protected Resolver resolveDerivePathResolver()
Creates the Resolver for a unqualified derived path expression.

Returns:
A non-null Resolver

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference