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

public Class SimpleFromClauseStateObject

extends AbstractFromClauseStateObject
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.parser.InternalSimpleFromClauseBNF, .SimpleFromClause, org.eclipse.persistence.jpa.jpql.tools.spi.IManagedType

The FROM clause of a sub-query defines the domain of the sub-query by declaring identification variables. An identification variable is an identifier declared in the FROM clause of a sub-query. The domain of the sub-query may be constrained by path expressions. Identification variables designate instances of a particular entity abstract schema type. The FROM clause can contain multiple identification variable declarations separated by a comma (,).
BNF: subquery_from_clause ::= FROM subselect_identification_variable_declaration {, subselect_identification_variable_declaration}*
Author
Pascal Filion
Since
2.4
Version
2.4
See Also
SimpleFromClause

Field Summary

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractFromClauseStateObject:
VARIABLE_DECLARATIONS_LIST

Constructor Summary

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

Creates a new SimpleFromClauseStateObject.

Method Summary

Modifier and TypeMethod and Description
public void
public CollectionMemberDeclarationStateObject

Returns:

The CollectionMemberDeclarationStateObject representing the collection declaration
addDerivedCollectionDeclaration
()

Adds a new derived collection declaration to the FROM clause.

public CollectionMemberDeclarationStateObject

Returns:

The CollectionMemberDeclarationStateObject representing the collection declaration
addDerivedCollectionDeclaration
(String
The collection-valued path expression
collectionValuedPath
)

Adds a new derived collection declaration to the FROM clause.

public DerivedPathIdentificationVariableDeclarationStateObject

Returns:

The DerivedPathIdentificationVariableDeclarationStateObject representing the path declaration
addDerivedPathDeclaration
()

Adds a new derived identification variable declaration to the FROM clause.

public DerivedPathIdentificationVariableDeclarationStateObject

Returns:

The DerivedPathIdentificationVariableDeclarationStateObject representing the path declaration
addDerivedPathDeclaration
(String
Either the derived singled-valued object field or the collection-valued path expression
path
,
String
The identification variable defining the given path
identificationVariable
)

Adds a new derived identification variable declaration to the FROM clause.

public String
declarationBNF()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractFromClauseStateObject.declarationBNF.

Returns the BNF of the declaration part of this clause.
public IManagedType
findManagedType(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.DeclarationStateObject.findManagedType.

Returns the IManagedType for the given identification variable.
public SimpleFromClause
getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractFromClauseStateObject.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 SimpleSelectStatementStateObject
public void
setExpression(SimpleFromClause
The parsed object representing a subquery FROM clause
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.

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractFromClauseStateObject:
addCollectionDeclarationaddCollectionDeclarationaddProblemsaddRangeDeclarationaddRangeDeclarationaddRangeDeclarationdeclarationsfindIdentificationVariablegetDeclarationgetManagedTypeidentificationVariablesisEquivalentlistNameparsetoTextInternal

Constructor Detail

SimpleFromClauseStateObjectback to summary
public SimpleFromClauseStateObject(SimpleSelectStatementStateObject parent)

Creates a new SimpleFromClauseStateObject.

Parameters
parent:SimpleSelectStatementStateObject

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
addDerivedCollectionDeclarationback to summary
public CollectionMemberDeclarationStateObject addDerivedCollectionDeclaration()

Adds a new derived collection declaration to the FROM clause.

Returns:CollectionMemberDeclarationStateObject

The CollectionMemberDeclarationStateObject representing the collection declaration

addDerivedCollectionDeclarationback to summary
public CollectionMemberDeclarationStateObject addDerivedCollectionDeclaration(String collectionValuedPath)

Adds a new derived collection declaration to the FROM clause.

Parameters
collectionValuedPath:String

The collection-valued path expression

Returns:CollectionMemberDeclarationStateObject

The CollectionMemberDeclarationStateObject representing the collection declaration

addDerivedPathDeclarationback to summary
public DerivedPathIdentificationVariableDeclarationStateObject addDerivedPathDeclaration()

Adds a new derived identification variable declaration to the FROM clause.

Returns:DerivedPathIdentificationVariableDeclarationStateObject

The DerivedPathIdentificationVariableDeclarationStateObject representing the path declaration

addDerivedPathDeclarationback to summary
public DerivedPathIdentificationVariableDeclarationStateObject addDerivedPathDeclaration(String path, String identificationVariable)

Adds a new derived identification variable declaration to the FROM clause.

Parameters
path:String

Either the derived singled-valued object field or the collection-valued path expression

identificationVariable:String

The identification variable defining the given path

Returns:DerivedPathIdentificationVariableDeclarationStateObject

The DerivedPathIdentificationVariableDeclarationStateObject representing the path declaration

declarationBNFback to summary
public String declarationBNF()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractFromClauseStateObject.declarationBNF.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractFromClauseStateObject.declarationBNF.

Returns the BNF of the declaration part of this clause.

Returns:String

The BNF of the declaration part of this clause

Annotations
@Override
findManagedTypeback to summary
public IManagedType findManagedType(StateObject stateObject)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject.findManagedType.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject.findManagedType.

Returns the IManagedType for the given identification variable. If the declaration is for a subquery and there is no managed type associated with the identification then the search will traverse up the query hierarchy.

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
getExpressionback to summary
public SimpleFromClause getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractFromClauseStateObject.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:SimpleFromClause

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
getParentback to summary
public SimpleSelectStatementStateObject getParent()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractFromClauseStateObject.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:SimpleSelectStatementStateObject

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

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

The parsed object representing a subquery FROM clause