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

public Class CollectionMemberExpressionStateObject

extends AbstractStateObject
Class Inheritance
Annotations
@SuppressWarnings:nls, unused
Imports
java.io.IOException, java.util.List, org.eclipse.persistence.jpa.jpql.parser.CollectionMemberExpression

This expression tests whether the designated value is a member of the collection specified by the collection-valued path expression. If the collection-valued path expression designates an empty collection, the value of the MEMBER OF expression is FALSE and the value of the NOT MEMBER OF expression is TRUE. Otherwise, if the value of the collection-valued path expression or single-valued association-field path expression in the collection member expression is NULL or unknown, the value of the collection member expression is unknown.

BNF: collection_member_expression ::= entity_or_value_expression [NOT] MEMBER [OF] collection_valued_path_expression

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
CollectionMemberExpression

Field Summary

Modifier and TypeField and Description
private CollectionValuedPathExpressionStateObject
public static final String
ENTITY_STATE_OBJECT_PROPERTY

Notifies the entity state object property has changed.

private StateObject
private boolean
not

Determines whether the NOT identifier is part of the expression or not.

public static final String
NOT_PROPERTY

Notifies the visibility of the NOT identifier has changed.

private boolean
of

Determines whether the OF identifier is part of the expression or not.

public static final String
OF_PROPERTY

Notifies the visibility of the OF identifier has changed.

Constructor Summary

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

Creates a new CollectionMemberExpressionStateObject.

public
CollectionMemberExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
StateObject entityStateObject, boolean
Determines whether the NOT identifier is part of the expression or not
not
,
boolean of, String collectionValuedPath)

Creates a new CollectionMemberExpressionStateObject.

public
CollectionMemberExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
StateObject entityStateObject, String collectionValuedPath)

Creates a new CollectionMemberExpressionStateObject.

Method Summary

Modifier and TypeMethod and Description
public void
protected void
addChildren(List<StateObject>
The list used to store the children
children
)

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

Adds the children of this StateObject to the given list.
public CollectionMemberExpressionStateObject

Returns:

This object
addNot
()

Makes sure the NOT identifier is specified.

public CollectionMemberExpressionStateObject

Returns:

This object
addOf
()

Makes sure the OF identifier is specified.

public CollectionValuedPathExpressionStateObject
public StateObject
public CollectionMemberExpression
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
public boolean

Returns:

true if the NOT identifier is part of the expression; false otherwise
hasNot
()

Determines whether the NOT identifier is used or not.

public boolean
protected void
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.
public void
removeNot()

Makes sure the NOT identifier is not specified.

public void
removeOf()

Makes sure the OF identifier is not specified.

public void
setEntityStateObject(StateObject entityStateObject)

Sets

public void
setExpression(CollectionMemberExpression
The parsed object representing a collection member 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.

public void
setNot(boolean
true if the NOT identifier should be part of the expression; false otherwise
not
)

Sets whether the NOT identifier should be part of the expression or not.

public void
setOf(boolean of)

public void
toggleNot()

Changes the visibility state of the NOT identifier.

public void
toggleOf()

Changes the visibility state of the OF identifier.

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.AbstractStateObject:
acceptUnknownVisitoracceptUnknownVisitoraddProblemsaddPropertyChangeListenerareEquivalentbuildProblembuildProblembuildStateObjectbuildStateObjectscheckParentchildrendecorateequalsfindIdentificationVariablefirePropertyChangedgetChangeSupportgetDeclarationgetDecoratorgetGrammargetManagedTypeProvidergetParentgetQueryBuildergetRootgetTypegetTypegetTypeHelpergetTypeRepositoryhashCodeisDecoratedparentparentparentremovePropertyChangeListenersetExpressionsetParenttoStringtoStringtoStringInternaltoStringItemstoText

Field Detail

collectionValuedPathback to summary
private CollectionValuedPathExpressionStateObject collectionValuedPath
ENTITY_STATE_OBJECT_PROPERTYback to summary
public static final String ENTITY_STATE_OBJECT_PROPERTY

Notifies the entity state object property has changed.

entityStateObjectback to summary
private StateObject entityStateObject
notback to summary
private boolean not

Determines whether the NOT identifier is part of the expression or not.

NOT_PROPERTYback to summary
public static final String NOT_PROPERTY

Notifies the visibility of the NOT identifier has changed.

ofback to summary
private boolean of

Determines whether the OF identifier is part of the expression or not.

OF_PROPERTYback to summary
public static final String OF_PROPERTY

Notifies the visibility of the OF identifier has changed.

Constructor Detail

CollectionMemberExpressionStateObjectback to summary
public CollectionMemberExpressionStateObject(StateObject parent)

Creates a new CollectionMemberExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
CollectionMemberExpressionStateObjectback to summary
public CollectionMemberExpressionStateObject(StateObject parent, StateObject entityStateObject, boolean not, boolean of, String collectionValuedPath)

Creates a new CollectionMemberExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

not:boolean

Determines whether the NOT identifier is part of the expression or not

Exceptions
NullPointerException:
The given parent cannot be null
CollectionMemberExpressionStateObjectback to summary
public CollectionMemberExpressionStateObject(StateObject parent, StateObject entityStateObject, String collectionValuedPath)

Creates a new CollectionMemberExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

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
addChildrenback to summary
protected void addChildren(List<StateObject> children)

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

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

Adds the children of this StateObject to the given list.

Parameters
children:List<StateObject>

The list used to store the children

Annotations
@Override
addNotback to summary
public CollectionMemberExpressionStateObject addNot()

Makes sure the NOT identifier is specified.

Returns:CollectionMemberExpressionStateObject

This object

addOfback to summary
public CollectionMemberExpressionStateObject addOf()

Makes sure the OF identifier is specified.

Returns:CollectionMemberExpressionStateObject

This object

getCollectionValuedPathback to summary
public CollectionValuedPathExpressionStateObject getCollectionValuedPath()
getEntityStateObjectback to summary
public StateObject getEntityStateObject()
getExpressionback to summary
public CollectionMemberExpression 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:CollectionMemberExpression

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
hasEntityStateObjectback to summary
public boolean hasEntityStateObject()
hasNotback to summary
public boolean hasNot()

Determines whether the NOT identifier is used or not.

Returns:boolean

true if the NOT identifier is part of the expression; false otherwise

hasOfback to summary
public boolean hasOf()
initializeback to summary
protected void initialize()

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

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

Initializes this state object.

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
removeNotback to summary
public void removeNot()

Makes sure the NOT identifier is not specified.

removeOfback to summary
public void removeOf()

Makes sure the OF identifier is not specified.

setEntityStateObjectback to summary
public void setEntityStateObject(StateObject entityStateObject)

Sets

setExpressionback to summary
public void setExpression(CollectionMemberExpression 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:CollectionMemberExpression

The parsed object representing a collection member expression

setNotback to summary
public void setNot(boolean not)

Sets whether the NOT identifier should be part of the expression or not.

Parameters
not:boolean

true if the NOT identifier should be part of the expression; false otherwise

setOfback to summary
public void setOf(boolean of)
toggleNotback to summary
public void toggleNot()

Changes the visibility state of the NOT identifier.

toggleOfback to summary
public void toggleOf()

Changes the visibility state of the OF identifier.

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