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

public Class RangeVariableDeclarationStateObject

extends AbstractRangeVariableDeclarationStateObject
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.tools.spi.IEntity, .IManagedType

Range variable declarations allow the developer to designate a "root" for objects which may not be reachable by navigation. In order to select values by comparing more than one instance of an entity abstract schema type, more than one identification variable ranging over the abstract schema type is needed in the FROM clause.

BNF: range_variable_declaration ::= abstract_schema_name [AS] identification_variable

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
RangeVariableDeclaration

Field Summary

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject:
AS_PROPERTYIDENTIFICATION_VARIABLE_PROPERTY

Constructor Summary

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

Creates a new RangeVariableDeclarationStateObject.

public
RangeVariableDeclarationStateObject(IdentificationVariableDeclarationStateObject
The parent of this state object, which cannot be null
parent
)

Creates a new RangeVariableDeclarationStateObject.

public
RangeVariableDeclarationStateObject(IdentificationVariableDeclarationStateObject
The parent of this state object, which cannot be null
parent
,
String
The name of the abstract schema, which is the name of the entity
entityName
)

Creates a new RangeVariableDeclarationStateObject.

Method Summary

Modifier and TypeMethod and Description
public void
public RangeVariableDeclarationStateObject
protected StateObject
public IEntity

Returns:

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

Returns the actual IEntity that has the abstract schema name.

public String

Returns:

The name of the abstract schema type for which the identification variable is ranging over
getEntityName
()

Returns the abstract schema name.

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 String
getRootPath()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject.getRootPath.

Returns the "root" object for objects which may not be reachable by navigation.
public AbstractSchemaNameStateObject
public void
setDeclaration(IEntity
The IEntity that this clause will range over
entity
)

Sets the abstract schema name to the given value.

public void
setDeclaration(IEntity
The IEntity that this clause will range over
entity
,
String
The new identification variable
identificationVariable
)

Sets the abstract schema name to the given value and the identification variable that will range over it.

public void
setDeclaration(String
The name of the entity name
entityName
,
String
The new identification variable
identificationVariable
)

Sets the abstract schema name to the given value and the identification variable that will range over it.

public void
setEntity(IEntity
The IEntity that the clause will range over
entity
)

Sets the actual IEntity and updates the abstract schema name.

public void
setEntityName(String
The name of the abstract schema, which is the name of the entity
abstractSchemaName
)

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

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

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject.setRootPath.

Sets the "root" object for objects which may not be reachable by navigation.
Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject:
addChildrenaddProblemsgetExpressiongetIdentificationVariablegetIdentificationVariableStateObjecthasAshasIdentificationVariableidentificationVariablesinitializeisEquivalentisIdentificationVariableOptionalisIdentificationVariableVirtualsetAssetExpressionsetIdentificationVariablesetIdentificationVariableOptionaltoggleAstoTextInternal

Constructor Detail

RangeVariableDeclarationStateObjectback to summary
public RangeVariableDeclarationStateObject(AbstractModifyClauseStateObject parent)

Creates a new RangeVariableDeclarationStateObject.

Parameters
parent:AbstractModifyClauseStateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
RangeVariableDeclarationStateObjectback to summary
public RangeVariableDeclarationStateObject(IdentificationVariableDeclarationStateObject parent)

Creates a new RangeVariableDeclarationStateObject.

Parameters
parent:IdentificationVariableDeclarationStateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
RangeVariableDeclarationStateObjectback to summary
public RangeVariableDeclarationStateObject(IdentificationVariableDeclarationStateObject parent, String entityName)

Creates a new RangeVariableDeclarationStateObject.

Parameters
parent:IdentificationVariableDeclarationStateObject

The parent of this state object, which cannot be null

entityName:String

The name of the abstract schema, which is the name of the entity

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
addAsback to summary
public RangeVariableDeclarationStateObject addAs()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject.addAs.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject.addAs.

Makes sure the AS identifier is specified.

Returns:RangeVariableDeclarationStateObject

This object

Annotations
@Override
buildRootStateObjectback to summary
protected StateObject buildRootStateObject()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject.buildRootStateObject.

Annotations
@Override
getEntityback to summary
public IEntity getEntity()

Returns the actual IEntity that has the abstract schema name.

Returns:IEntity

The actual IEntity or null if no entity exists

getEntityNameback to summary
public String getEntityName()

Returns the abstract schema name.

Returns:String

The name of the abstract schema type for which the identification variable is ranging over

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
getRootPathback to summary
public String getRootPath()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject.getRootPath.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject.getRootPath.

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

Returns:String

The "root" object

Annotations
@Override
getRootStateObjectback to summary
public AbstractSchemaNameStateObject getRootStateObject()

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

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

Returns the StateObject holding onto the abstract schema name.

Returns:AbstractSchemaNameStateObject

The StateObject, which is never null

Annotations
@Override
setDeclarationback to summary
public void setDeclaration(IEntity entity)

Sets the abstract schema name to the given value.

Parameters
entity:IEntity

The IEntity that this clause will range over

setDeclarationback to summary
public void setDeclaration(IEntity entity, String identificationVariable)

Sets the abstract schema name to the given value and the identification variable that will range over it.

Parameters
entity:IEntity

The IEntity that this clause will range over

identificationVariable:String

The new identification variable

setDeclarationback to summary
public void setDeclaration(String entityName, String identificationVariable)

Sets the abstract schema name to the given value and the identification variable that will range over it.

Parameters
entityName:String

The name of the entity name

identificationVariable:String

The new identification variable

setEntityback to summary
public void setEntity(IEntity entity)

Sets the actual IEntity and updates the abstract schema name.

Parameters
entity:IEntity

The IEntity that the clause will range over

setEntityNameback to summary
public void setEntityName(String abstractSchemaName)

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

Parameters
abstractSchemaName:String

The name of the abstract schema, which is the name of the entity

setRootPathback to summary
public void setRootPath(String root)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject.setRootPath.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject.setRootPath.

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

Parameters
root:String

The "root" object

Annotations
@Override