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

public Class ConcatExpressionStateObject

extends AbstractListHolderStateObject<StateObject>
Class Inheritance
Annotations
@SuppressWarnings:nls, unused
Imports
java.io.IOException, java.util.List, org.eclipse.persistence.jpa.jpql.parser.ConcatExpression

The CONCAT function returns a string that is a concatenation of its arguments.

JPA 1.0:

BNF: expression ::= CONCAT(string_primary, string_primary)

JPA 2.0

BNF: expression ::= CONCAT(string_primary, string_primary {, string_primary}*)

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
ConcatExpression

Field Summary

Modifier and TypeField and Description
public static final String
STRING_PRIMARY_STATE_OBJECT_LIST

Notifies the content of the list of StateObject representing the string primaries has changed.

Constructor Summary

AccessConstructor and Description
public
ConcatExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
)

Creates a new ConcatExpressionStateObject.

public
ConcatExpressionStateObject(StateObject parent, List<? extends StateObject>
The list of StateObject representing the encapsulated expressions
stateObjects
)

Creates a new ConcatExpressionStateObject.

public
ConcatExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
StateObject...
The list of StateObject representing the encapsulated expressions
stateObjects
)

Creates a new ConcatExpressionStateObject.

Method Summary

Modifier and TypeMethod and Description
public void
public ConcatExpression
getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.getExpression.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.
public boolean
isEquivalent(StateObject
The StateObject to compare its content to this one
stateObject
)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.isEquivalent.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.isEquivalent.

Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.
protected String
listName()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject.listName.

Returns the name that is uniquely identifying the list.
public void
setExpression(ConcatExpression
The parsed object representing a CONCAT expression
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.

protected void
toTextInternal(Appendable
The writer used to print out the string representation
writer
)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.toTextInternal.

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.
Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject:
addChildrenaddItemaddItemsaddListChangeListenerareChildrenEquivalentcanMoveDowncanMoveUpgetItemhasItemsinitializeitemsitemsSizemoveDownmoveUpremoveItemremoveItemsremoveListChangeListenertoStringItems

Field Detail

STRING_PRIMARY_STATE_OBJECT_LISTback to summary
public static final String STRING_PRIMARY_STATE_OBJECT_LIST

Notifies the content of the list of StateObject representing the string primaries has changed.

Constructor Detail

ConcatExpressionStateObjectback to summary
public ConcatExpressionStateObject(StateObject parent)

Creates a new ConcatExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
ConcatExpressionStateObjectback to summary
public ConcatExpressionStateObject(StateObject parent, List<? extends StateObject> stateObjects)

Creates a new ConcatExpressionStateObject.

Parameters
stateObjects:List<? extends StateObject>

The list of StateObject representing the encapsulated expressions

ConcatExpressionStateObjectback to summary
public ConcatExpressionStateObject(StateObject parent, StateObject... stateObjects)

Creates a new ConcatExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

stateObjects:StateObject[]

The list of StateObject representing the encapsulated expressions

Exceptions
NullPointerException:
The given parent cannot be null

Method Detail

acceptback to summary
public void accept(StateObjectVisitor visitor)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.accept.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.accept.

Visits this StateObject by the given visitor.

Parameters
visitor:StateObjectVisitor

The visitor to visit this object

Annotations
@Override
getExpressionback to summary
public ConcatExpression getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.getExpression.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.

Returns:ConcatExpression

The parsed object when a JPQL query is parsed and converted into a StateObject or null when the JPQL query is manually created (i.e. not from a string)

Annotations
@Override
isEquivalentback to summary
public boolean isEquivalent(StateObject stateObject)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.isEquivalent.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.isEquivalent.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.isEquivalent.

Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.

Parameters
stateObject:StateObject

The StateObject to compare its content to this one

Returns:boolean

true if both object are equivalent; false otherwise

Annotations
@Override
listNameback to summary
protected String listName()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject.listName.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject.listName.

Returns the name that is uniquely identifying the list.

Returns:String

The unique name identifying the list

Annotations
@Override
setExpressionback to summary
public void setExpression(ConcatExpression 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.

Parameters
expression:ConcatExpression

The parsed object representing a CONCAT expression

toTextInternalback to summary
protected void toTextInternal(Appendable writer) throws IOException

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.toTextInternal.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.toTextInternal.

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.

Parameters
writer:Appendable

The writer used to print out the string representation

Annotations
@Override
Exceptions
IOException:
This should never happens, it is only required because Appendable is used instead of any concrete class