|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) E28847-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.eclipse.persistence.jpa.internal.jpql.AbstractJPQLQueryHelper
public abstract class AbstractJPQLQueryHelper
This helper can perform the following operations over a JPQL query:
getResultType()
;getParameterType(String)
.#buildContentAssistItems(int)
.Field Summary | |
---|---|
private ContentAssistVisitor |
contentAssistVisitor This visitor is responsible to gather the possible proposals based on the position of the caret within the JPQL query. |
private GrammarValidator |
grammarValidator This visitor is responsible to visit the entire parsed tree representation of the JPQL query and to validate its content based on the JPQL grammar. |
private JPQLQueryContext |
queryContext The context used to query information about the JPQL query. |
private SemanticValidator |
semanticValidator This visitor is responsible to visit the entire parsed tree representation of the JPQL query and to validate the semantic of the information. |
Constructor Summary | |
---|---|
protected |
AbstractJPQLQueryHelper() Creates a new AbstractJPQLQueryHelper . |
protected |
AbstractJPQLQueryHelper(JPQLQueryContext queryContext) Creates a new AbstractJPQLQueryHelper . |
Method Summary | |
---|---|
protected ContentAssistProposals |
buildContentAssistProposals(int position) Retrieves the possibles choices that can complete the query from the given position within the query. |
private java.util.Comparator<IType> |
buildNumericTypeComparator() |
private ContentAssistVisitor |
contentAssistVisitor() |
protected void |
dispose() Disposes of the internal data. |
private JPQLExpression |
getJPQLExpression() |
protected IType |
getParameterType(java.lang.String parameterName) Retrieves, if it can be determined, the type of the given input parameter with the given name. |
protected java.lang.String |
getParsedJPQLQuery() Returns the string representation of the parsed tree. |
protected IManagedTypeProvider |
getProvider() Returns the provider for managed types (entities, embeddables, mapped superclasses). |
protected IQuery |
getQuery() Returns the external form representing a named query. |
protected JPQLQueryContext |
getQueryContext() Returns the JPQLQueryContext that contains information about the JPQL query. |
protected IType |
getResultType() Calculates the type of the query result of the JPQL query. |
protected IType |
getType(java.lang.Class<?> type) Returns the IType representing the given Java type. |
protected TypeHelper |
getTypeHelper() Returns a helper that gives access to the most common types . |
protected ITypeRepository |
getTypeRepository() Returns the repository that gives access to the application's types. |
private GrammarValidator |
grammarValidator() |
private SemanticValidator |
semanticValidator() |
void |
setJPQLExpression(JPQLExpression jpqlExpression) Sets |
protected void |
setQuery(IQuery query) Sets the external form of the JPQL query, which will be parsed and information will be extracted for later access. |
protected java.util.List<JPQLQueryProblem> |
validate() Validates the query by introspecting it grammatically and semantically. |
void |
validate(Expression expression, java.util.List<JPQLQueryProblem> problems) Validates the query by introspecting it grammatically and semantically. |
protected java.util.List<JPQLQueryProblem> |
validateGrammar() Validates the query by only introspecting it grammatically. |
void |
validateGrammar(Expression expression, java.util.List<JPQLQueryProblem> problems) Validates the query by only introspecting it grammatically. |
protected java.util.List<JPQLQueryProblem> |
validateSemantic() Validates the query by only introspecting it semantically. |
void |
validateSemantic(Expression expression, java.util.List<JPQLQueryProblem> problems) Validates the query by only introspecting it semantically. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ContentAssistVisitor contentAssistVisitor
private GrammarValidator grammarValidator
private final JPQLQueryContext queryContext
private SemanticValidator semanticValidator
Constructor Detail |
---|
protected AbstractJPQLQueryHelper()
AbstractJPQLQueryHelper
.protected AbstractJPQLQueryHelper(JPQLQueryContext queryContext)
AbstractJPQLQueryHelper
.
queryContext
- The context used to query information about the JPQL queryMethod Detail |
---|
protected 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 queryprivate ContentAssistVisitor contentAssistVisitor()
protected void dispose()
private JPQLExpression getJPQLExpression()
protected 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 determinedprivate java.util.Comparator<IType> buildNumericTypeComparator()
protected java.lang.String getParsedJPQLQuery()
protected IManagedTypeProvider getProvider()
protected IQuery getQuery()
protected JPQLQueryContext getQueryContext()
JPQLQueryContext
that contains information about the JPQL query.JPQLQueryContext
that contains information contained in the JPQL queryprotected IType getResultType()
See TypeVisitor
to understand how the type is calculated.
IClass
for Object
if it could not be calculatedprotected IType getType(java.lang.Class<?> type)
IType
representing the given Java type.type
- The Java type for which its external form is requestedprotected TypeHelper getTypeHelper()
types
.IType
protected ITypeRepository getTypeRepository()
private GrammarValidator grammarValidator()
private SemanticValidator semanticValidator()
public final void setJPQLExpression(JPQLExpression jpqlExpression)
jpqlExpression
-protected void setQuery(IQuery query)
query
- The external form of the JPQL queryprotected java.util.List<JPQLQueryProblem> validate()
null
list that will be used to store the problems
if any was foundpublic void validate(Expression expression, java.util.List<JPQLQueryProblem> problems)
jpqlExpression
- The parsed tree representation of the queryproblems
- A non-null
list that will be used to store the problems
if any was foundprotected java.util.List<JPQLQueryProblem> validateGrammar()
null
list that will be used to store the problems
if any was foundpublic void validateGrammar(Expression expression, java.util.List<JPQLQueryProblem> problems)
expression
- The parsed tree representation of the queryproblems
- A non-null
list that will be used to store the problems
if any was foundprotected java.util.List<JPQLQueryProblem> validateSemantic()
null
list that will be used to store the problems
if any was foundpublic void validateSemantic(Expression expression, java.util.List<JPQLQueryProblem> problems)
expression
- The parsed tree representation of the queryproblems
- A non-null
list that will be used to store the problems
if any was found
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |