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

public Class TreatResolver

extends Resolver
Class Inheritance
Annotations
@SuppressWarnings:nls
Imports
org.eclipse.persistence.jpa.jpql.tools.spi.IManagedType, .ITypeDeclaration

This Resolver resolves a path and casts it as another entity type.
Author
Pascal Filion
Since
2.3
Version
2.5

Field Summary

Modifier and TypeField and Description
private String
entityTypeName

The entity type name used to downcast the collection-valued field.

Constructor Summary

AccessConstructor and Description
public
TreatResolver(Resolver
The parent of this resolver, which is never null
parent
,
String
The entity type name used to downcast the collection-valued field
entityTypeName
)

Creates a new TreatResolver.

Method Summary

Modifier and TypeMethod and Description
protected ITypeDeclaration
public String

Returns:

The entity type name used to downcast the path expression
getEntityTypeName
()

Returns the entity type name used to downcast the path expression.

public IManagedType
getManagedType()

Overrides org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.getManagedType.

Returns the IManagedType associated with the field handled by this Resolver.
public void
setNullAllowed(boolean
true to allow null if the corresponding relationship in the database does not exists; false otherwise
nullAllowed
)

Overrides org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.setNullAllowed.

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.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver:
addChildbuildTypecheckParentgetChildgetMappinggetParentgetParentManagedTypegetParentMappinggetParentTypegetParentTypeDeclarationgetProvidergetQuerygetTypegetTypegetTypegetTypeDeclarationgetTypeHelpergetTypeRepositoryisNullAllowed

Field Detail

entityTypeNameback to summary
private String entityTypeName

The entity type name used to downcast the collection-valued field.

Constructor Detail

TreatResolverback to summary
public TreatResolver(Resolver parent, String entityTypeName)

Creates a new TreatResolver.

Parameters
parent:Resolver

The parent of this resolver, which is never null

entityTypeName:String

The entity type name used to downcast the collection-valued field

Method Detail

buildTypeDeclarationback to summary
protected ITypeDeclaration buildTypeDeclaration()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.buildTypeDeclaration.

Doc from org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.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

Annotations
@Override
getEntityTypeNameback to summary
public String getEntityTypeName()

Returns the entity type name used to downcast the path expression.

Returns:String

The entity type name used to downcast the path expression

getManagedTypeback to summary
public IManagedType getManagedType()

Overrides org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.getManagedType.

Doc from org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.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

Annotations
@Override
setNullAllowedback to summary
public void setNullAllowed(boolean nullAllowed)

Overrides org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.setNullAllowed.

Doc from org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.setNullAllowed.

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

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override