Class ConcatExpressionStateObject
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject<StateObject>
-
- org.eclipse.persistence.jpa.jpql.tools.model.query.ConcatExpressionStateObject
-
- All Implemented Interfaces:
ListHolderStateObject<StateObject>
,StateObject
public class ConcatExpressionStateObject extends AbstractListHolderStateObject<StateObject>
TheCONCAT
function returns a string that is a concatenation of its arguments.JPA 1.0:
BNF:JPA 2.0expression ::= CONCAT(string_primary, string_primary)
BNF:expression ::= CONCAT(string_primary, string_primary {, string_primary}*)
- Since:
- 2.4
- Version:
- 2.4
- Author:
- Pascal Filion
- See Also:
ConcatExpression
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
STRING_PRIMARY_STATE_OBJECT_LIST
Notifies the content of the list ofStateObject
representing the string primaries has changed.
-
Constructor Summary
Constructors Constructor Description ConcatExpressionStateObject(StateObject parent)
Creates a newConcatExpressionStateObject
.ConcatExpressionStateObject(StateObject parent, java.util.List<? extends StateObject> stateObjects)
Creates a newConcatExpressionStateObject
.ConcatExpressionStateObject(StateObject parent, StateObject... stateObjects)
Creates a newConcatExpressionStateObject
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(StateObjectVisitor visitor)
Visits thisStateObject
by the givenvisitor
.ConcatExpression
getExpression()
Returns the actual parsed object if thisStateObject
representation of the JPQL query was created by parsing an existing JPQL query.boolean
isEquivalent(StateObject stateObject)
Determines whether the givenStateObject
is equivalent to this one, i.e.void
setExpression(ConcatExpression expression)
Keeps a reference of theparsed object
object, 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.AbstractListHolderStateObject
addItem, addItems, addListChangeListener, canMoveDown, canMoveUp, getItem, hasItems, items, itemsSize, moveDown, moveUp, removeItem, removeItems, removeListChangeListener
-
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
-
Methods inherited from interface org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject
addPropertyChangeListener, children, decorate, findIdentificationVariable, getDeclaration, getDecorator, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, isDecorated, removePropertyChangeListener, setParent, toString, toText
-
-
-
-
Field Detail
-
STRING_PRIMARY_STATE_OBJECT_LIST
public static final java.lang.String STRING_PRIMARY_STATE_OBJECT_LIST
Notifies the content of the list ofStateObject
representing the string primaries has changed.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConcatExpressionStateObject
public ConcatExpressionStateObject(StateObject parent)
Creates a newConcatExpressionStateObject
.- Parameters:
parent
- The parent of this state object, which cannot benull
- Throws:
java.lang.NullPointerException
- The given parent cannot benull
-
ConcatExpressionStateObject
public ConcatExpressionStateObject(StateObject parent, java.util.List<? extends StateObject> stateObjects)
Creates a newConcatExpressionStateObject
.- Parameters:
stateObjects
- The list ofStateObject
representing the encapsulated expressions
-
ConcatExpressionStateObject
public ConcatExpressionStateObject(StateObject parent, StateObject... stateObjects)
Creates a newConcatExpressionStateObject
.- Parameters:
parent
- The parent of this state object, which cannot benull
stateObjects
- The list ofStateObject
representing the encapsulated expressions- Throws:
java.lang.NullPointerException
- The given parent cannot benull
-
-
Method Detail
-
accept
public void accept(StateObjectVisitor visitor)
Visits thisStateObject
by the givenvisitor
.- Parameters:
visitor
- Thevisitor
to visit this object
-
getExpression
public ConcatExpression getExpression()
Returns the actual parsed object if thisStateObject
representation of the JPQL query was created by parsing an existing JPQL query.- Specified by:
getExpression
in interfaceStateObject
- Overrides:
getExpression
in classAbstractStateObject
- Returns:
- The parsed object when a JPQL query is parsed and converted into a
StateObject
ornull
when the JPQL query is manually created (i.e. not from a string)
-
isEquivalent
public boolean isEquivalent(StateObject stateObject)
Determines whether the givenStateObject
is equivalent to this one, i.e. the information of bothStateObject
is the same.- Specified by:
isEquivalent
in interfaceStateObject
- Overrides:
isEquivalent
in classAbstractStateObject
- Parameters:
stateObject
- TheStateObject
to compare its content to this one- Returns:
true
if both object are equivalent;false
otherwise
-
setExpression
public void setExpression(ConcatExpression expression)
Keeps a reference of theparsed object
object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query intoStateObjects
.- Parameters:
expression
- Theparsed object
representing aCONCAT
expression
-
-