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

public Class FromClauseStateObject

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

The FROM clause of a query defines the domain of the query by declaring identification variables. An identification variable is an identifier declared in the FROM clause of a query. The domain of the 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: from_clause ::= FROM identification_variable_declaration {, {identification_variable_declaration | collection_member_declaration}}*
Author
Pascal Filion
Since
2.4
Version
2.4
See Also
CollectionMemberDeclarationStateObject, IdentificationVariableDeclarationStateObject, JoinStateObject, SelectStatementStateObject, FromClause

Field Summary

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

Constructor Summary

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

Creates a new FromClauseStateObject.

Method Summary

Modifier and TypeMethod and Description
public void
protected 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 FromClause
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 SelectStatementStateObject
public void
setExpression(FromClause
The parsed object representing a FROM 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.

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

Constructor Detail

FromClauseStateObjectback to summary
public FromClauseStateObject(SelectStatementStateObject parent)

Creates a new FromClauseStateObject.

Parameters
parent:SelectStatementStateObject

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
declarationBNFback to summary
protected 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 FromClause 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:FromClause

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

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(FromClause 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:FromClause

The parsed object representing a FROM expression