Top Description Methods
org.eclipse.persistence.jpa.jpql.tools.model

public Interface IJPQLQueryBuilder

Known Direct Implementers
org.eclipse.persistence.jpa.jpql.tools.model.JPQLQueryBuilderWrapper, org.eclipse.persistence.jpa.jpql.tools.model.AbstractJPQLQueryBuilder
Imports
org.eclipse.persistence.jpa.jpql.parser.JPQLGrammar, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractConditionalClauseStateObject, .JPQLQueryStateObject, .SelectClauseStateObject, .SimpleSelectClauseStateObject, .StateObject, .UpdateItemStateObject, org.eclipse.persistence.jpa.jpql.tools.spi.IManagedTypeProvider

This builder is responsible to create an editable StateObject representation of a JPQL query.

Some default implementations are available:

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
IManagedTypeProvider, StateObject

Method Summary

Modifier and TypeMethod and Description
public ICaseExpressionStateObjectBuilder

Returns:

The builder of a CASE expression
buildCaseExpressionStateObjectBuilder
(StateObject
The StateObject that will be the parent of the newly created model
parent
)

Creates a builder that can create a CASE expression programmatically.

public JPQLQueryStateObject

Returns:

The root of the StateObject model that represents the edited form of the JPQL query
buildStateObject
(IManagedTypeProvider
The provider of managed types
provider
,
CharSequence
The JPQL query to parse into a StateObject model
jpqlQuery
,
boolean
Determines if the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries
tolerant
)

Creates a state model representation of a JPQL query that can be edited.

public JPQLQueryStateObject

Returns:

The root of the StateObject model that represents the edited form of the JPQL query
buildStateObject
(IManagedTypeProvider
The provider of managed types
provider
,
CharSequence
The JPQL query to parse into a StateObject model
jpqlQuery
,
String
The unique identifier of the query BNF that will be used to parse the fragment
queryBNFId
,
boolean
Determines if the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries
tolerant
)

Creates a state model representation of a JPQL query that can be edited.

public StateObject

Returns:

The StateObject representation of the given JPQL fragment
buildStateObject
(StateObject
The StateObject that will be the parent of the newly created model
parent
,
CharSequence
A portion of a JPQL query that will be parsed and the StateObject representation will be created
jpqlFragment
,
String
The unique identifier of the query BNF that will be used to parse the fragment
queryBNFId
)

Creates a StateObject representation of the given JPQL fragment.

public IConditionalExpressionStateObjectBuilder

Returns:

The builder of a conditional expression
buildStateObjectBuilder
(AbstractConditionalClauseStateObject
The clause for which a conditional expression can be created
stateObject
)

Creates a builder that can create a conditional expression programmatically.

public ISelectExpressionStateObjectBuilder

Returns:

The builder of a conditional expression
buildStateObjectBuilder
(SelectClauseStateObject
The clause for which one or many select expressions can be created
stateObject
)

Creates a builder that can create a select expression programmatically.

public ISimpleSelectExpressionStateObjectBuilder

Returns:

The builder of a conditional expression
buildStateObjectBuilder
(SimpleSelectClauseStateObject
The clause for which a select expression can be created
stateObject
)

Creates a builder that can create a single select expression programmatically.

public INewValueStateObjectBuilder

Returns:

The builder of a new value expression
buildStateObjectBuilder
(UpdateItemStateObject
The parent for which a new value expression can be created
stateObject
)

Creates a builder that can create a new value expression programmatically.

public JPQLGrammar

Returns:

The JPQLGrammar that was used to parse the JPQL query or JPQL fragments
getGrammar
()

Returns the JPQLGrammar that is associated with this builder.

Method Detail

buildCaseExpressionStateObjectBuilderback to summary
public ICaseExpressionStateObjectBuilder buildCaseExpressionStateObjectBuilder(StateObject parent)

Creates a builder that can create a CASE expression programmatically. Once the expression is complete, ICaseExpressionStateObjectBuilder#buildStateObject() will return the result.

Parameters
parent:StateObject

The StateObject that will be the parent of the newly created model

Returns:ICaseExpressionStateObjectBuilder

The builder of a CASE expression

buildStateObjectback to summary
public JPQLQueryStateObject buildStateObject(IManagedTypeProvider provider, CharSequence jpqlQuery, boolean tolerant)

Creates a state model representation of a JPQL query that can be edited.

Parameters
provider:IManagedTypeProvider

The provider of managed types

jpqlQuery:CharSequence

The JPQL query to parse into a StateObject model

tolerant:boolean

Determines if the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries

Returns:JPQLQueryStateObject

The root of the StateObject model that represents the edited form of the JPQL query

buildStateObjectback to summary
public JPQLQueryStateObject buildStateObject(IManagedTypeProvider provider, CharSequence jpqlQuery, String queryBNFId, boolean tolerant)

Creates a state model representation of a JPQL query that can be edited.

Parameters
provider:IManagedTypeProvider

The provider of managed types

jpqlQuery:CharSequence

The JPQL query to parse into a StateObject model

queryBNFId:String

The unique identifier of the query BNF that will be used to parse the fragment

tolerant:boolean

Determines if the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries

Returns:JPQLQueryStateObject

The root of the StateObject model that represents the edited form of the JPQL query

buildStateObjectback to summary
public StateObject buildStateObject(StateObject parent, CharSequence jpqlFragment, String queryBNFId)

Creates a StateObject representation of the given JPQL fragment. In order to properly parse the fragment, the given unique identifier of the JPQLQueryBNF will determine how to parse it.

It is possible the given JPQL fragment has more than one expression, in this case, parsing should stop at the first comma (x, y) or space (x y) where x and y are two separate expressions.

Parameters
parent:StateObject

The StateObject that will be the parent of the newly created model

jpqlFragment:CharSequence

A portion of a JPQL query that will be parsed and the StateObject representation will be created

queryBNFId:String

The unique identifier of the query BNF that will be used to parse the fragment

Returns:StateObject

The StateObject representation of the given JPQL fragment

buildStateObjectBuilderback to summary
public IConditionalExpressionStateObjectBuilder buildStateObjectBuilder(AbstractConditionalClauseStateObject stateObject)

Creates a builder that can create a conditional expression programmatically. Once the expression is complete, IConditionalExpressionStateObjectBuilder#commit() will push the result onto the given state object.

Parameters
stateObject:AbstractConditionalClauseStateObject

The clause for which a conditional expression can be created

Returns:IConditionalExpressionStateObjectBuilder

The builder of a conditional expression

buildStateObjectBuilderback to summary
public ISelectExpressionStateObjectBuilder buildStateObjectBuilder(SelectClauseStateObject stateObject)

Creates a builder that can create a select expression programmatically. Once the expression is complete, ISelectExpressionStateObjectBuilder#commit() will push the result onto the given state object.

Parameters
stateObject:SelectClauseStateObject

The clause for which one or many select expressions can be created

Returns:ISelectExpressionStateObjectBuilder

The builder of a conditional expression

buildStateObjectBuilderback to summary
public ISimpleSelectExpressionStateObjectBuilder buildStateObjectBuilder(SimpleSelectClauseStateObject stateObject)

Creates a builder that can create a single select expression programmatically. Once the expression is complete, ISimpleSelectExpressionStateObjectBuilder#commit() will push the result onto the given state object.

Parameters
stateObject:SimpleSelectClauseStateObject

The clause for which a select expression can be created

Returns:ISimpleSelectExpressionStateObjectBuilder

The builder of a conditional expression

buildStateObjectBuilderback to summary
public INewValueStateObjectBuilder buildStateObjectBuilder(UpdateItemStateObject stateObject)

Creates a builder that can create a new value expression programmatically. Once the expression is complete, INewValueStateObjectBuilder#commit() will push the result onto the given state object.

Parameters
stateObject:UpdateItemStateObject

The parent for which a new value expression can be created

Returns:INewValueStateObjectBuilder

The builder of a new value expression

getGrammarback to summary
public JPQLGrammar getGrammar()

Returns the JPQLGrammar that is associated with this builder.

Returns:JPQLGrammar

The JPQLGrammar that was used to parse the JPQL query or JPQL fragments