public class JPQLQueryHelper extends AbstractJPQLQueryHelper
getResultType()
;getParameterType(String)
.#buildContentAssistItems(int)
.Constructor and Description |
---|
JPQLQueryHelper()
Creates a new
JPQLQueryHelper . |
JPQLQueryHelper(JPQLQueryContext queryContext)
Creates a new
JPQLQueryHelper . |
Modifier and Type | Method and Description |
---|---|
ContentAssistProposals |
buildContentAssistProposals(int position)
Retrieves the possibles choices that can complete the query from the given position within
the query.
|
void |
dispose()
Disposes of the internal data.
|
IType |
getParameterType(java.lang.String parameterName)
Retrieves, if it can be determined, the type of the given input parameter with the given name.
|
java.lang.String |
getParsedJPQLQuery()
Returns the string representation of the parsed tree.
|
IManagedTypeProvider |
getProvider()
Returns the provider for managed types (entities, embeddables, mapped superclasses).
|
IQuery |
getQuery()
Returns the external form representing a named query.
|
IType |
getResultType()
Calculates the type of the query result of the JPQL query.
|
IType |
getType(java.lang.Class<?> type)
Returns the
IType representing the given Java type. |
TypeHelper |
getTypeHelper()
Returns a helper that gives access to the most common
types . |
ITypeRepository |
getTypeRepository()
Returns the repository that gives access to the application's types.
|
void |
setQuery(IQuery query)
Sets the external form of the JPQL query, which will be parsed and information will be
extracted for later access.
|
java.util.List<JPQLQueryProblem> |
validate()
Validates the query by introspecting it grammatically and semantically.
|
java.util.List<JPQLQueryProblem> |
validateGrammar()
Validates the query by only introspecting it grammatically.
|
java.util.List<JPQLQueryProblem> |
validateSemantic()
Validates the query by only introspecting it semantically.
|
setJPQLExpression, validate, validateGrammar, validateSemantic
public JPQLQueryHelper()
JPQLQueryHelper
.public JPQLQueryHelper(JPQLQueryContext queryContext)
JPQLQueryHelper
.queryContext
- The context used to query information about the JPQL querypublic ContentAssistProposals buildContentAssistProposals(int position)
Note: Disposing of the internal data is not done automatically.
position
- The position within the query for which a list of possible choices are created
for completing the querypublic void dispose()
public IType getParameterType(java.lang.String parameterName)
Note: Both named and positional input parameter can be used.
parameterName
- The name of the input parameter to retrieve its type, which needs to be
prepended by ':' or '?'null
if the type
couldn't be determinedpublic java.lang.String getParsedJPQLQuery()
public IManagedTypeProvider getProvider()
public IQuery getQuery()
public IType getResultType()
See TypeVisitor
to understand how the type is calculated.
IClass
for Object
if it could not be calculatedpublic IType getType(java.lang.Class<?> type)
IType
representing the given Java type.type
- The Java type for which its external form is requestedpublic TypeHelper getTypeHelper()
types
.IType
public ITypeRepository getTypeRepository()
public void setQuery(IQuery query)
query
- The external form of the JPQL querypublic java.util.List<JPQLQueryProblem> validate()
null
list that will be used to store the problems
if any was foundpublic java.util.List<JPQLQueryProblem> validateGrammar()
null
list that will be used to store the problems
if any was foundpublic java.util.List<JPQLQueryProblem> validateSemantic()
null
list that will be used to store the problems
if any was foundEclipseLink 2.3.2, "build v20111125-r10461" API Reference