Class TreatResolver
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
-
- org.eclipse.persistence.jpa.jpql.tools.resolver.TreatResolver
-
-
Constructor Summary
Constructors Constructor Description TreatResolver(Resolver parent, java.lang.String entityTypeName)
Creates a newTreatResolver
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ITypeDeclaration
buildTypeDeclaration()
Resolves theITypeDeclaration
of the property handled by thisResolver
.java.lang.String
getEntityTypeName()
Returns the entity type name used to downcast the path expression.IManagedType
getManagedType()
Returns theIManagedType
associated with the field handled by thisResolver
.void
setNullAllowed(boolean nullAllowed)
Sets whether theExpression
to be created, which wraps the attribute or query key name allows the target of the 1:1 relationship to benull
if there is no corresponding relationship in the database.java.lang.String
toString()
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
addChild, buildType, checkParent, getChild, getMapping, getParent, getParentManagedType, getParentMapping, getParentType, getParentTypeDeclaration, getProvider, getQuery, getType, getType, getType, getTypeDeclaration, getTypeHelper, getTypeRepository, isNullAllowed
-
-
-
-
Constructor Detail
-
TreatResolver
public TreatResolver(Resolver parent, java.lang.String entityTypeName)
Creates a newTreatResolver
.- Parameters:
parent
- The parent of this resolver, which is nevernull
entityTypeName
- The entity type name used to downcast the collection-valued field
-
-
Method Detail
-
buildTypeDeclaration
protected ITypeDeclaration buildTypeDeclaration()
Resolves theITypeDeclaration
of the property handled by thisResolver
.- Specified by:
buildTypeDeclaration
in classResolver
- Returns:
- Either the
ITypeDeclaration
that was resolved by thisResolver
or theITypeDeclaration
forIType.UNRESOLVABLE_TYPE
if it could not be resolved
-
getEntityTypeName
public java.lang.String getEntityTypeName()
Returns the entity type name used to downcast the path expression.- Returns:
- The entity type name used to downcast the path expression
-
getManagedType
public IManagedType getManagedType()
Returns theIManagedType
associated with the field handled by thisResolver
. If thisResolver
does not handle a field that has aIManagedType
, thennull
should be returned.For example: "
SELECT e FROM Employee e
", theResolver
for e would be returning theIManagedType
for Employee.- Overrides:
getManagedType
in classResolver
- Returns:
- Either the
IManagedType
, if it could be resolved;null
otherwise
-
setNullAllowed
public void setNullAllowed(boolean nullAllowed)
Sets whether theExpression
to be created, which wraps the attribute or query key name allows the target of the 1:1 relationship to benull
if there is no corresponding relationship in the database.- Overrides:
setNullAllowed
in classResolver
- Parameters:
nullAllowed
-true
to allownull
if the corresponding relationship in the database does not exists;false
otherwise
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-