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

public abstract Class AbstractIdentificationVariableDeclarationStateObject

extends AbstractListHolderStateObject<JoinStateObject>
implements VariableDeclarationStateObject
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.jpa.jpql.tools.model.query.VariableDeclarationStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.model.query.DerivedPathIdentificationVariableDeclarationStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.IdentificationVariableDeclarationStateObject
Annotations
@SuppressWarnings:nls, unused
Imports
java.io.IOException, java.util.ArrayList, .List, .ListIterator, org.eclipse.persistence.jpa.jpql.parser.IdentificationVariableDeclaration, .JoinBNF, org.eclipse.persistence.jpa.jpql.utility.iterable.ListIterable, .SnapshotCloneListIterable

Author
Pascal Filion
Since
2.4
Version
2.5

Field Summary

Modifier and TypeField and Description
public static final String
JOINS_LIST

Notifies the content of the list of JoinStateObject has changed.

private AbstractRangeVariableDeclarationStateObject
rangeVariableDeclaration

The state object of the range variable declaration.

Constructor Summary

AccessConstructor and Description
protected
AbstractIdentificationVariableDeclarationStateObject(AbstractFromClauseStateObject
The parent of this state object, which cannot be null
parent
)

Creates a new AbstractIdentificationVariableDeclarationStateObject.

protected
AbstractIdentificationVariableDeclarationStateObject(AbstractFromClauseStateObject
The parent of this state object, which cannot be null
parent
,
String
The "root" object
root
,
String
The identification variable defining the given path
identificationVariable
)

Creates a new AbstractIdentificationVariableDeclarationStateObject.

Method Summary

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

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

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

Returns:

A new JoinStateObject
addInnerJoin
(String
The join association path expression
path
,
String
The new variable defining the join association path
identificationVariable
)

Adds a new INNER JOIN expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addJoin
(String
One of the joining types: LEFT JOIN, LEFT OUTER JOIN, INNER JOIN or JOIN
joinType
)

Adds a new JOIN expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addJoin
(String
One of the joining types: LEFT JOIN, LEFT OUTER JOIN, INNER JOIN or JOIN
joinType
,
ListIterator<String>
The join association path expression
paths
,
String
The new variable defining the join association path
identificationVariable
)

Adds a new JOIN expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addJoin
(String
The join association path expression
path
,
String
The new variable defining the join association path
identificationVariable
)

Adds a new JOIN expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addJoin
(String
One of the joining types: LEFT JOIN, LEFT OUTER JOIN, INNER JOIN or JOIN
joinType
,
String
The join association path expression
path
,
String
The new variable defining the join association path
identificationVariable
)

Adds a new JOIN expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addLeftJoin
(String
The join association path expression
path
,
String
The new variable defining the join association path
identificationVariable
)

Adds a new LEFT JOIN expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addLeftOuterJoin
(String
The join association path expression
path
,
String
The new variable defining the join association path
identificationVariable
)

Adds a new LEFT OUTER JOIN expression to this declaration.

protected abstract AbstractRangeVariableDeclarationStateObject
public IdentificationVariableDeclaration
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 String

Returns:

A case insensitive unique identifier declaring the "root" of the declaration
getIdentificationVariable
()

Returns the identification variable identifying the "root".

public IdentificationVariableStateObject

Returns:

The IdentificationVariableStateObject, which is never null
getIdentificationVariableStateObject
()

Returns the IdentificationVariableStateObject holding onto the identification variable.

public AbstractFromClauseStateObject
public AbstractRangeVariableDeclarationStateObject

Returns:

The concrete instance
getRangeVariableDeclaration
()

Returns the StateObject representing the range variable declaration portion.

public String

Returns:

The "root" object
getRootPath
()

Returns the "root" object for objects which may not be reachable by navigation.

public StateObject

Returns:

The StateObject representing one of the possible valid "root"
getRootStateObject
()

Returns the StateObject representing the "root" for objects which may not be reachable by navigation.

public ListIterable<IdentificationVariableStateObject>
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.
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
parseJoin(String
The portion representing a JOIN expression
jpqlFragment
)

Parses the given JPQL fragment that should contain a single JOIN expression.

public void
setExpression(IdentificationVariableDeclaration
The parsed object representing an identification variable declaration
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
setIdentificationVariable(String
The new identification variable
identificationVariable
)

Sets the new identification variable that will range over the "root".

public void
setRootPath(String
The "root" object
root
)

Sets the "root" object for objects which may not be reachable by navigation.

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:
addItemaddItemsaddListChangeListenerareChildrenEquivalentcanMoveDowncanMoveUpgetItemhasItemsitemsitemsSizemoveDownmoveUpremoveItemremoveItemsremoveListChangeListenertoStringItems

Field Detail

JOINS_LISTback to summary
public static final String JOINS_LIST

Notifies the content of the list of JoinStateObject has changed.

rangeVariableDeclarationback to summary
private AbstractRangeVariableDeclarationStateObject rangeVariableDeclaration

The state object of the range variable declaration.

Constructor Detail

AbstractIdentificationVariableDeclarationStateObjectback to summary
protected AbstractIdentificationVariableDeclarationStateObject(AbstractFromClauseStateObject parent)

Creates a new AbstractIdentificationVariableDeclarationStateObject.

Parameters
parent:AbstractFromClauseStateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
AbstractIdentificationVariableDeclarationStateObjectback to summary
protected AbstractIdentificationVariableDeclarationStateObject(AbstractFromClauseStateObject parent, String root, String identificationVariable)

Creates a new AbstractIdentificationVariableDeclarationStateObject.

Parameters
parent:AbstractFromClauseStateObject

The parent of this state object, which cannot be null

root:String

The "root" object

identificationVariable:String

The identification variable defining the given path

Exceptions
NullPointerException:
The given parent cannot be null

Method Detail

addChildrenback to summary
protected void addChildren(List<StateObject> children)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject.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
addInnerJoinback to summary
public JoinStateObject addInnerJoin(String path, String identificationVariable)

Adds a new INNER JOIN expression to this declaration.

Parameters
path:String

The join association path expression

identificationVariable:String

The new variable defining the join association path

Returns:JoinStateObject

A new JoinStateObject

addJoinback to summary
public JoinStateObject addJoin(String joinType)

Adds a new JOIN expression to this declaration.

Parameters
joinType:String

One of the joining types: LEFT JOIN, LEFT OUTER JOIN, INNER JOIN or JOIN

Returns:JoinStateObject

A new JoinStateObject

addJoinback to summary
public JoinStateObject addJoin(String joinType, ListIterator<String> paths, String identificationVariable)

Adds a new JOIN expression to this declaration.

Parameters
joinType:String

One of the joining types: LEFT JOIN, LEFT OUTER JOIN, INNER JOIN or JOIN

paths:ListIterator<String>

The join association path expression

identificationVariable:String

The new variable defining the join association path

Returns:JoinStateObject

A new JoinStateObject

addJoinback to summary
public JoinStateObject addJoin(String path, String identificationVariable)

Adds a new JOIN expression to this declaration.

Parameters
path:String

The join association path expression

identificationVariable:String

The new variable defining the join association path

Returns:JoinStateObject

A new JoinStateObject

addJoinback to summary
public JoinStateObject addJoin(String joinType, String path, String identificationVariable)

Adds a new JOIN expression to this declaration.

Parameters
joinType:String

One of the joining types: LEFT JOIN, LEFT OUTER JOIN, INNER JOIN or JOIN

path:String

The join association path expression

identificationVariable:String

The new variable defining the join association path

Returns:JoinStateObject

A new JoinStateObject

addLeftJoinback to summary
public JoinStateObject addLeftJoin(String path, String identificationVariable)

Adds a new LEFT JOIN expression to this declaration.

Parameters
path:String

The join association path expression

identificationVariable:String

The new variable defining the join association path

Returns:JoinStateObject

A new JoinStateObject

addLeftOuterJoinback to summary
public JoinStateObject addLeftOuterJoin(String path, String identificationVariable)

Adds a new LEFT OUTER JOIN expression to this declaration.

Parameters
path:String

The join association path expression

identificationVariable:String

The new variable defining the join association path

Returns:JoinStateObject

A new JoinStateObject

buildRangeVariableDeclarationStateObjectback to summary
protected abstract AbstractRangeVariableDeclarationStateObject buildRangeVariableDeclarationStateObject()

Creates

getExpressionback to summary
public IdentificationVariableDeclaration 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:IdentificationVariableDeclaration

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
getIdentificationVariableback to summary
public String getIdentificationVariable()

Returns the identification variable identifying the "root".

Returns:String

A case insensitive unique identifier declaring the "root" of the declaration

getIdentificationVariableStateObjectback to summary
public IdentificationVariableStateObject getIdentificationVariableStateObject()

Returns the IdentificationVariableStateObject holding onto the identification variable.

Returns:IdentificationVariableStateObject

The IdentificationVariableStateObject, which is never null

getParentback to summary
public AbstractFromClauseStateObject getParent()

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

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

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

Returns the parent of this StateObject.

Returns:AbstractFromClauseStateObject

Returns the parent of this StateObject, which is null only when this is the root of the hierarchy

Annotations
@Override
getRangeVariableDeclarationback to summary
public AbstractRangeVariableDeclarationStateObject getRangeVariableDeclaration()

Returns the StateObject representing the range variable declaration portion.

Returns:AbstractRangeVariableDeclarationStateObject

The concrete instance

getRootPathback to summary
public String getRootPath()

Returns the "root" object for objects which may not be reachable by navigation.

Returns:String

The "root" object

getRootStateObjectback to summary
public StateObject getRootStateObject()

Returns the StateObject representing the "root" for objects which may not be reachable by navigation.

Returns:StateObject

The StateObject representing one of the possible valid "root"

identificationVariablesback to summary
public ListIterable<IdentificationVariableStateObject> identificationVariables()

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.VariableDeclarationStateObject.identificationVariables.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.VariableDeclarationStateObject.identificationVariables.

Returns the IdentificationVariableStateObject that are used by this state object. It is possible more than one declaration exists, like a range variable declaration has also joins and join fetches.

Returns:ListIterable<IdentificationVariableStateObject>

The list of IdentificationVariableStateObject

Annotations
@Override
initializeback to summary
protected void initialize()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject.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
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
parseJoinback to summary
public void parseJoin(String jpqlFragment)

Parses the given JPQL fragment that should contain a single JOIN expression.

Parameters
jpqlFragment:String

The portion representing a JOIN expression

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

The parsed object representing an identification variable declaration

setIdentificationVariableback to summary
public void setIdentificationVariable(String identificationVariable)

Sets the new identification variable that will range over the "root".

Parameters
identificationVariable:String

The new identification variable

setRootPathback to summary
public void setRootPath(String root)

Sets the "root" object for objects which may not be reachable by navigation.

Parameters
root:String

The "root" object

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