|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.jpa.jpql.model.query.AbstractStateObject
org.eclipse.persistence.jpa.jpql.model.query.SimpleStateObject
org.eclipse.persistence.jpa.jpql.model.query.IdentificationVariableStateObject
public class IdentificationVariableStateObject
This state object represents a single identification variable, which is identifying TODO.
IdentificationVariable
Field Summary | |
---|---|
static java.lang.String |
DEFINED_PROPERTY
Notify a change in the defined property. |
Fields inherited from class org.eclipse.persistence.jpa.jpql.model.query.SimpleStateObject |
---|
TEXT_PROPERTY |
Constructor Summary | |
---|---|
IdentificationVariableStateObject(StateObject parent)
Creates a new IdentificationVariableStateObject . |
|
IdentificationVariableStateObject(StateObject parent,
java.lang.String variable)
Creates a new IdentificationVariableStateObject . |
Method Summary | |
---|---|
void |
accept(StateObjectVisitor visitor)
Visits this StateObject by the given visitor . |
protected void |
addProblems(java.util.List<Problem> problems)
Adds to the given list the problems that were found with the current state of this StateObject , which means there are validation issues. |
protected void |
checkIntegrity(java.lang.String text)
Makes sure the current identification variable and the given one are the same. |
protected void |
clearResolvedObjects()
Clears the values related to the managed type and type. |
IdentificationVariable |
getExpression()
Returns the actual parsed object if this StateObject representation of the JPQL query
was created by parsing an existing JPQL query. |
IManagedType |
getManagedType()
Returns the IManagedType associated with the field handled by this object. |
IMapping |
getMapping()
Returns |
IType |
getType()
Returns the IType of the field handled by this object. |
ITypeDeclaration |
getTypeDeclaration()
Returns the ITypeDeclaration of the field handled by this object. |
boolean |
isEquivalent(StateObject stateObject)
Determines whether the given StateObject is equivalent to this one, i.e. the
information of both StateObject is the same. |
boolean |
isVirtual()
Determines whether this identification variable is virtual, meaning it's not part of the query but is required for proper navigability. |
protected IManagedType |
resolveManagedType()
Retrieves the IManagedType that is mapped to the identification variable, if and only
if the identification variable is used to declare an entity. |
protected IMapping |
resolveMapping()
Resolves |
protected IType |
resolveType()
Resolves the IType of the property handled by this object. |
protected ITypeDeclaration |
resolveTypeDeclaration()
Resolves the ITypeDeclaration of the property handled by this object. |
void |
setExpression(IdentificationVariable expression)
Keeps a reference of the parsed object object, which should only be
done when this object is instantiated during the conversion of a parsed JPQL query into
StateObjects . |
void |
setText(java.lang.String text)
Sets the text held by this state object. |
void |
setVirtual(boolean virtual)
Sets whether this identification variable is virtual, meaning it's not part of the query but is required for proper navigability. |
protected void |
toTextInternal(java.lang.Appendable writer)
Prints out a string representation of this StateObject , which should not be used to
define a true string representation of a JPQL query but should be used for
debugging purposes. |
Methods inherited from class org.eclipse.persistence.jpa.jpql.model.query.SimpleStateObject |
---|
getText, hasText, setTextInternally |
Methods inherited from class org.eclipse.persistence.jpa.jpql.model.query.AbstractStateObject |
---|
acceptUnknownVisitor, acceptUnknownVisitor, addChildren, addPropertyChangeListener, areEquivalent, buildProblem, buildProblem, buildStateObject, buildStateObjects, checkParent, children, decorate, equals, findIdentificationVariable, firePropertyChanged, getChangeSupport, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, initialize, isDecorated, parent, parent, parent, removePropertyChangeListener, setExpression, setParent, toString, toString, toStringInternal, toStringItems, toText |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFINED_PROPERTY
Constructor Detail |
---|
public IdentificationVariableStateObject(StateObject parent)
IdentificationVariableStateObject
.
parent
- The parent of this state object, which cannot be null
java.lang.NullPointerException
- The given parent cannot be null
public IdentificationVariableStateObject(StateObject parent, java.lang.String variable)
IdentificationVariableStateObject
.
parent
- The parent of this state object, which cannot be null
variable
- The name of the identification variable
java.lang.NullPointerException
- The given parent cannot be null
Method Detail |
---|
public void accept(StateObjectVisitor visitor)
StateObject
by the given visitor
.
visitor
- The visitor
to visit this objectprotected void addProblems(java.util.List<Problem> problems)
StateObject
, which means there are validation issues.
addProblems
in class AbstractStateObject
problems
- The list to which the problems are addedprotected void checkIntegrity(java.lang.String text)
text
- The new identification variableprotected void clearResolvedObjects()
public IdentificationVariable getExpression()
StateObject
representation of the JPQL query
was created by parsing an existing JPQL query.
getExpression
in interface StateObject
getExpression
in class AbstractStateObject
StateObject
or null
when the JPQL query is manually created (i.e. not from a string)public IManagedType getManagedType()
IManagedType
associated with the field handled by this object. If this
object does not handle a field that has a IManagedType
, then null
should
be returned.
For example: "SELECT e FROM Employee e
", the object for e
would be returning the IManagedType
for Employee.
IManagedType
, if it could be resolved; null
otherwisepublic IMapping getMapping()
public IType getType()
IType
of the field handled by this object.
IType
that was resolved by this state object or the IType
for IType.UNRESOLVABLE_TYPE
if it could not be resolvedpublic ITypeDeclaration getTypeDeclaration()
ITypeDeclaration
of the field handled by this object.
ITypeDeclaration
that was resolved by this object or the ITypeDeclaration
for IType.UNRESOLVABLE_TYPE
if it could not be resolvedpublic boolean isEquivalent(StateObject stateObject)
StateObject
is equivalent to this one, i.e. the
information of both StateObject
is the same.
isEquivalent
in interface StateObject
isEquivalent
in class SimpleStateObject
stateObject
- The StateObject
to compare its content to this one
true
if both object are equivalent; false
otherwisepublic boolean isVirtual()
true
if this identification variable was virtually created to fully
qualify path expression; false
if it was parsedprotected IManagedType resolveManagedType()
IManagedType
that is mapped to the identification variable, if and only
if the identification variable is used to declare an entity.
IManagedType
declared by the identification variable or null
if it could not be resolvedprotected IMapping resolveMapping()
protected IType resolveType()
IType
of the property handled by this object.
IType
that was resolved by this object or the IType
for
IType.UNRESOLVABLE_TYPE
if it could not be resolvedprotected ITypeDeclaration resolveTypeDeclaration()
ITypeDeclaration
of the property handled by this object.
ITypeDeclaration
that was resolved by this object or the ITypeDeclaration
for IType.UNRESOLVABLE_TYPE
if it could not be resolvedpublic void setExpression(IdentificationVariable expression)
parsed object
object, which should only be
done when this object is instantiated during the conversion of a parsed JPQL query into
StateObjects
.
expression
- The parsed object
representing an
identification variablepublic void setText(java.lang.String text)
setText
in class SimpleStateObject
text
- This model's text valuepublic void setVirtual(boolean virtual)
virtual
- true
if this identification variable was virtually created to
fully qualify path expression; false
if it was parsedprotected void toTextInternal(java.lang.Appendable writer) throws java.io.IOException
StateObject
, which should not be used to
define a true
string representation of a JPQL query but should be used for
debugging purposes.
toTextInternal
in class SimpleStateObject
writer
- The writer used to print out the string representation
java.io.IOException
- This should never happens, it is only required because Appendable
is used instead of any concrete class
|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |