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

public Class IdentificationVariableDeclarationStateObject

extends AbstractIdentificationVariableDeclarationStateObject
Class Inheritance
Imports
java.util.ListIterator, org.eclipse.persistence.jpa.jpql.tools.spi.IEntity, .IManagedType

An identification variable is a valid identifier declared in the FROM clause of a query. All identification variables must be declared in the FROM clause. Identification variables cannot be declared in other clauses. An identification variable must not be a reserved identifier or have the same name as any entity in the same persistence unit: Identification variables are case insensitive. An identification variable evaluates to a value of the type of the expression used in declaring the variable.

BNF: identification_variable_declaration ::= range_variable_declaration { join | fetch_join }*

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
IdentificationVariableDeclaration

Field Summary

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject:
JOINS_LIST

Constructor Summary

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

Creates a new IdentificationVariableDeclarationStateObject.

public
IdentificationVariableDeclarationStateObject(AbstractFromClauseStateObject
The parent of this state object, which cannot be null
parent
,
IEntity
The external form of the entity to add to the declaration list
entity
,
String
The unique identifier identifying the abstract schema name
identificationVariable
)

Creates a new IdentificationVariableDeclarationStateObject.

public
IdentificationVariableDeclarationStateObject(AbstractFromClauseStateObject
The parent of this state object, which cannot be null
parent
,
String
The name of the entity name
entityName
,
String
The new identification variable
identificationVariable
)

Creates a new IdentificationVariableDeclarationStateObject.

Method Summary

Modifier and TypeMethod and Description
public void
public JoinStateObject

Returns:

A new JoinStateObject
addInnerJoinFetch
(String
The join association path expression
path
)

Adds a new INNER JOIN FETCH expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addJoinFetch
(String
The join association path expression
path
)

Adds a new JOIN FETCH expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addJoinFetch
(String
One of the joining types: LEFT JOIN FETCH, LEFT OUTER JOIN FETCH, INNER JOIN FETCH or JOIN FETCH
joinFetchType
,
ListIterator<String>
The join association path expression
paths
)

Adds a new JOIN FETCH expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addJoinFetch
(String
One of the joining types: LEFT JOIN FETCH, LEFT OUTER JOIN FETCH, INNER JOIN FETCH or JOIN FETCH
joinFetchType
,
String
The join association path expression
path
)

Adds a new JOIN FETCH expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addJoinFetchType
(String
One of the joining types: LEFT JOIN FETCH, LEFT OUTER JOIN FETCH, INNER JOIN FETCH or JOIN FETCH
joinFetchType
)

Adds a new JOIN FETCH expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addLeftJoinFetch
(String
The join association path expression
path
)

Adds a new LEFT JOIN FETCH expression to this declaration.

public JoinStateObject

Returns:

A new JoinStateObject
addLeftOuterJoinFetch
(String
The join association path expression
path
)

Adds a new LEFT OUTER JOIN FETCH expression to this declaration.

protected AbstractRangeVariableDeclarationStateObject
public IEntity

Returns:

The actual IEntity or null if no entity exists with the entity name
getEntity
()

Returns the actual external form representing the IEntity.

public String

Returns:

The name of the entity
getEntityName
()

Returns the name of the entity for which it is used as the "root" of the declaration.

public IManagedType
getManagedType(StateObject
The StateObject that should be an simple identification variable or an encapsulated identification variable with the identifier KEY or VALUE
stateObject
)

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

Returns the IManagedType for the given identification variable.
public RangeVariableDeclarationStateObject
public AbstractSchemaNameStateObject
getRootStateObject()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject.getRootStateObject.

Returns the StateObject representing the "root" for objects which may not be reachable by navigation.
protected String
public void
setEntity(IEntity
The IEntity itself
entity
)

Sets the IEntity as the "root".

public void
setEntityName(String
The name of the entity
entityName
)

Sets the name of the abstract schema, which is the name of the entity.

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject:
addChildrenaddInnerJoinaddJoinaddJoinaddJoinaddJoinaddLeftJoinaddLeftOuterJoingetExpressiongetIdentificationVariablegetIdentificationVariableStateObjectgetParentgetRootPathidentificationVariablesinitializeisEquivalentparseJoinsetExpressionsetIdentificationVariablesetRootPathtoTextInternal

Constructor Detail

IdentificationVariableDeclarationStateObjectback to summary
public IdentificationVariableDeclarationStateObject(AbstractFromClauseStateObject parent)

Creates a new IdentificationVariableDeclarationStateObject.

Parameters
parent:AbstractFromClauseStateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
IdentificationVariableDeclarationStateObjectback to summary
public IdentificationVariableDeclarationStateObject(AbstractFromClauseStateObject parent, IEntity entity, String identificationVariable)

Creates a new IdentificationVariableDeclarationStateObject.

Parameters
parent:AbstractFromClauseStateObject

The parent of this state object, which cannot be null

entity:IEntity

The external form of the entity to add to the declaration list

identificationVariable:String

The unique identifier identifying the abstract schema name

Exceptions
NullPointerException:
The given parent cannot be null
IdentificationVariableDeclarationStateObjectback to summary
public IdentificationVariableDeclarationStateObject(AbstractFromClauseStateObject parent, String entityName, String identificationVariable)

Creates a new IdentificationVariableDeclarationStateObject.

Parameters
parent:AbstractFromClauseStateObject

The parent of this state object, which cannot be null

entityName:String

The name of the entity name

identificationVariable:String

The new identification variable

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
addInnerJoinFetchback to summary
public JoinStateObject addInnerJoinFetch(String path)

Adds a new INNER JOIN FETCH expression to this declaration.

Parameters
path:String

The join association path expression

Returns:JoinStateObject

A new JoinStateObject

addJoinFetchback to summary
public JoinStateObject addJoinFetch(String path)

Adds a new JOIN FETCH expression to this declaration.

Parameters
path:String

The join association path expression

Returns:JoinStateObject

A new JoinStateObject

addJoinFetchback to summary
public JoinStateObject addJoinFetch(String joinFetchType, ListIterator<String> paths)

Adds a new JOIN FETCH expression to this declaration.

Parameters
joinFetchType:String

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

paths:ListIterator<String>

The join association path expression

Returns:JoinStateObject

A new JoinStateObject

addJoinFetchback to summary
public JoinStateObject addJoinFetch(String joinFetchType, String path)

Adds a new JOIN FETCH expression to this declaration.

Parameters
joinFetchType:String

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

path:String

The join association path expression

Returns:JoinStateObject

A new JoinStateObject

addJoinFetchTypeback to summary
public JoinStateObject addJoinFetchType(String joinFetchType)

Adds a new JOIN FETCH expression to this declaration.

Parameters
joinFetchType:String

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

Returns:JoinStateObject

A new JoinStateObject

addLeftJoinFetchback to summary
public JoinStateObject addLeftJoinFetch(String path)

Adds a new LEFT JOIN FETCH expression to this declaration.

Parameters
path:String

The join association path expression

Returns:JoinStateObject

A new JoinStateObject

addLeftOuterJoinFetchback to summary
public JoinStateObject addLeftOuterJoinFetch(String path)

Adds a new LEFT OUTER JOIN FETCH expression to this declaration.

Parameters
path:String

The join association path expression

Returns:JoinStateObject

A new JoinStateObject

buildRangeVariableDeclarationStateObjectback to summary
protected AbstractRangeVariableDeclarationStateObject buildRangeVariableDeclarationStateObject()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject.buildRangeVariableDeclarationStateObject.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject.buildRangeVariableDeclarationStateObject.

Creates

Annotations
@Override
getEntityback to summary
public IEntity getEntity()

Returns the actual external form representing the IEntity.

Returns:IEntity

The actual IEntity or null if no entity exists with the entity name

getEntityNameback to summary
public String getEntityName()

Returns the name of the entity for which it is used as the "root" of the declaration.

Returns:String

The name of the entity

getManagedTypeback to summary
public IManagedType getManagedType(StateObject stateObject)

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

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

Returns the IManagedType for the given identification variable. The search does not traverse up the query hierarchy if this declaration is for a subquery.

SELECT e FROM Department d JOIN KEY(d.employees).addresses a
In the above query, the managed type associated with the identification variable:
  • d is "Department"
  • a is "Address"
Parameters
stateObject:StateObject

The StateObject that should be an simple identification variable or an encapsulated identification variable with the identifier KEY or VALUE

Returns:IManagedType

The IManagedType representing the domain object declared by the given identification variable

Annotations
@Override
getRangeVariableDeclarationback to summary
public RangeVariableDeclarationStateObject getRangeVariableDeclaration()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject.getRangeVariableDeclaration.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject.getRangeVariableDeclaration.

Returns the StateObject representing the range variable declaration portion.

Returns:RangeVariableDeclarationStateObject

The concrete instance

Annotations
@Override
getRootStateObjectback to summary
public AbstractSchemaNameStateObject getRootStateObject()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject.getRootStateObject.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject.getRootStateObject.

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

Returns:AbstractSchemaNameStateObject

The StateObject representing one of the possible valid "root"

Annotations
@Override
listNameback to summary
protected String listName()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractIdentificationVariableDeclarationStateObject.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
setEntityback to summary
public void setEntity(IEntity entity)

Sets the IEntity as the "root".

Parameters
entity:IEntity

The IEntity itself

setEntityNameback to summary
public void setEntityName(String entityName)

Sets the name of the abstract schema, which is the name of the entity.

Parameters
entityName:String

The name of the entity