Class ObjectExpressionStateObject
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.EncapsulatedIdentificationVariableExpressionStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.ObjectExpressionStateObject
-
- All Implemented Interfaces:
StateObject
public class ObjectExpressionStateObject extends EncapsulatedIdentificationVariableExpressionStateObject
Stand-alone identification variables in theSELECTclause may optionally be qualified by theOBJECToperator. TheSELECTclause must not use theOBJECToperator to qualify path expressions.BNF:expression ::= OBJECT(identification_variable)- Since:
- 2.4
- Version:
- 2.4
- Author:
- Pascal Filion
- See Also:
ObjectExpression
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.EncapsulatedIdentificationVariableExpressionStateObject
IDENTIFICATION_VARIABLE_PROPERTY
-
Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject
STATE_OBJECT_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description ObjectExpressionStateObject(StateObject parent)Creates a newObjectExpressionStateObject.ObjectExpressionStateObject(StateObject parent, String identificationVariable)Creates a newObjectExpressionStateObject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(StateObjectVisitor visitor)Visits thisStateObjectby the givenvisitor.ObjectExpressiongetExpression()Returns the actual parsed object if thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.StringgetIdentifier()Returns the JPQL identifier of the expression represented by thisAbstractSingleEncapsulatedExpressionStateObject.voidsetExpression(ObjectExpression expression)Keeps a reference of theparsed objectobject, which should only be done when this object is instantiated during the conversion of a parsed JPQL query intoStateObjects.-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.EncapsulatedIdentificationVariableExpressionStateObject
getIdentificationVariable, getManagedType, getStateObject, getType, getTypeDeclaration, hasIdentificationVariable, setIdentificationVariable
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSingleEncapsulatedExpressionStateObject
hasStateObject, isEquivalent, parse
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
addPropertyChangeListener, children, decorate, equals, findIdentificationVariable, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, getType, getType, getTypeHelper, getTypeRepository, hashCode, isDecorated, removePropertyChangeListener, setExpression, setParent, toString, toString, toText
-
-
-
-
Constructor Detail
-
ObjectExpressionStateObject
public ObjectExpressionStateObject(StateObject parent)
Creates a newObjectExpressionStateObject.- Parameters:
parent- The parent of this state object, which cannot benull- Throws:
NullPointerException- The given parent cannot benull
-
ObjectExpressionStateObject
public ObjectExpressionStateObject(StateObject parent, String identificationVariable)
Creates a newObjectExpressionStateObject.- Parameters:
parent- The parent of this state object, which cannot benullidentificationVariable- The name of the identification variable- Throws:
NullPointerException- The given parent cannot benull
-
-
Method Detail
-
accept
public void accept(StateObjectVisitor visitor)
Visits thisStateObjectby the givenvisitor.- Parameters:
visitor- Thevisitorto visit this object
-
getExpression
public ObjectExpression getExpression()
Returns the actual parsed object if thisStateObjectrepresentation of the JPQL query was created by parsing an existing JPQL query.- Specified by:
getExpressionin interfaceStateObject- Overrides:
getExpressionin classEncapsulatedIdentificationVariableExpressionStateObject- Returns:
- The parsed object when a JPQL query is parsed and converted into a
StateObjectornullwhen the JPQL query is manually created (i.e. not from a string)
-
getIdentifier
public String getIdentifier()
Returns the JPQL identifier of the expression represented by thisAbstractSingleEncapsulatedExpressionStateObject.- Specified by:
getIdentifierin classAbstractEncapsulatedExpressionStateObject- Returns:
- The JPQL identifier that is shown before the left parenthesis
-
setExpression
public void setExpression(ObjectExpression expression)
Keeps a reference of theparsed objectobject, which should only be done when this object is instantiated during the conversion of a parsed JPQL query intoStateObjects.- Parameters:
expression- Theparsed objectrepresenting anOBJECTexpression
-
-