|
Dali Provisional API Release 3.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectAbstractJPQLQueryHelper
org.eclipse.jpt.jpa.core.jpql.JpaJpqlQueryHelper
public abstract class JpaJpqlQueryHelper
This helper can perform the following operations over a JPQL query:
#getResultType();#getParameterType(String).#buildContentAssistItems(int).#validate(),#validateGrammar(),#validateSemantic().
| Nested Class Summary | |
|---|---|
static class |
JpaJpqlQueryHelper.EscapeType
Constants used to determine how to escape the JPQL query. |
| Constructor Summary | |
|---|---|
protected |
JpaJpqlQueryHelper(JPQLGrammar jpqlGrammar)
Creates a new JpaQueryHelper. |
| Method Summary | |
|---|---|
ContentAssistProposals |
buildContentAssistProposals(int position)
|
protected ContentAssistExtension |
buildContentAssistProposalsHelper()
Creates the helper that will be used to extend the support for JPQL content assist. |
protected abstract IManagedTypeBuilder |
buildManagedTypeBuilder()
Create the builder that will create the right implementation of {@link org.eclipse.persistence. |
protected abstract |
buildMappingBuilder()
Create the builder that will create the right implementation of {@link org.eclipse.persistence. |
int[] |
buildPositions(JPQLQueryProblem problem,
String parsedJpqlQuery,
String jpqlQuery,
String actualJpqlQuery,
int offset,
JpaJpqlQueryHelper.EscapeType escapeType)
Calculates the start and end positions by adjusting them to be at the same position within jpqlQuery, which may differ from parsedJpqlQuery since the parsed tree does not keep track of multiple whitespace. |
protected List<IMessage> |
buildProblems(NamedQuery namedQuery,
List<TextRange> textRanges,
JPQLQueryProblem problem,
String parsedJpqlQuery,
String jpqlQuery,
String actualJpqlQuery,
int offset,
JpaJpqlQueryHelper.EscapeType escapeType,
int severity)
Creates a new IMessage for the given JPQLQueryProblem. |
protected JpaManagedTypeProvider |
buildProvider(JpaProject jpaProject,
PersistenceUnit persistenceUnit)
Creates a new JpaManagedTypeProvider which will provide access to the application's
JPA metadata information. |
protected int |
getValidationSeverity(NamedQuery namedQuery)
|
void |
setQuery(NamedQuery namedQuery,
String actualQuery)
Sets the given named query and string representation of the JPQL query. |
void |
validate(NamedQuery namedQuery,
String jpqlQuery,
String actualJpqlQuery,
List<TextRange> textRanges,
int offset,
JpaJpqlQueryHelper.EscapeType escapeType,
List<IMessage> messages)
Validates the given NamedQuery by validating the JPQL query. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected JpaJpqlQueryHelper(JPQLGrammar jpqlGrammar)
JpaQueryHelper.
jpqlGrammar - The grammar that defines how to parse a JPQL query| Method Detail |
|---|
public ContentAssistProposals buildContentAssistProposals(int position)
protected ContentAssistExtension buildContentAssistProposalsHelper()
GenericContentAssistProposalHelperprotected abstract IManagedTypeBuilder buildManagedTypeBuilder()
jpa.jpql.spi.IManagedType IManagedType.
IMappingBuilderprotected abstractbuildMappingBuilder()
jpa.jpql.spi.IMapping IMapping.
IMappingBuilder
public int[] buildPositions(JPQLQueryProblem problem,
String parsedJpqlQuery,
String jpqlQuery,
String actualJpqlQuery,
int offset,
JpaJpqlQueryHelper.EscapeType escapeType)
problem - The problem that was found in the JPQL query, which is
either a grammatical or semantic problemparsedJpqlQuery - The generated string from parser.JPQLExpression JPQLExpressionjpqlQuery - The actual JPQL query that was parsed and validatedactualJpqlQuery - The actual string that is not escaped and found in the document (either
in an XML file or in a Java annotation)offset - This offset is used to move the start positionescapeType - Determines how to escape the JPQL query, if required
protected List<IMessage> buildProblems(NamedQuery namedQuery,
List<TextRange> textRanges,
JPQLQueryProblem problem,
String parsedJpqlQuery,
String jpqlQuery,
String actualJpqlQuery,
int offset,
JpaJpqlQueryHelper.EscapeType escapeType,
int severity)
IMessage for the given JPQLQueryProblem.
namedQuery - The model object for which a new IMessage is creating describing the problemproblem - The problem that was found in the JPQL query, which is
either a grammatical or semantic problemtextRanges - The list of TextRange objects that represents the JPQL query string
within the document. The list should contain either one TextRange if the JPQL query is
a single string or many if the JPQL query is split into multiple stringsparsedJpqlQuery - The generated string from parser.JPQLExpression JPQLExpressionjpqlQuery - The actual JPQL query that was parsed and validatedactualJpqlQuery - The actual string that is not escaped and found in the document (either
in an XML file or in a Java annotation)offset - This offset is used to move the start positionescapeType - Determines how to escape the JPQL query, if required
IMessage objects that has the required information to display the
problem, which support split locations (i.e. for a split strings)
protected JpaManagedTypeProvider buildProvider(JpaProject jpaProject,
PersistenceUnit persistenceUnit)
JpaManagedTypeProvider which will provide access to the application's
JPA metadata information.
jpaProject - The JPA project associated with the Eclipse projectpersistenceUnit - The persistence unit model
JpaManagedTypeProviderprotected int getValidationSeverity(NamedQuery namedQuery)
public void setQuery(NamedQuery namedQuery,
String actualQuery)
namedQuery - The model object where the JPQL query is storedactualQuery - The actual JPQL query, which can differ from the one owned by the model
object, which happens when the model is out of sync because it has not been updated yet
public void validate(NamedQuery namedQuery,
String jpqlQuery,
String actualJpqlQuery,
List<TextRange> textRanges,
int offset,
JpaJpqlQueryHelper.EscapeType escapeType,
List<IMessage> messages)
NamedQuery by validating the JPQL query.
namedQuery - The JPQL query to validatejpqlQuery - The JPQL query, which might be different from what the model object since
the escape characters should not be in their literal forms (should have '\r' and not '\\r')textRanges - The list of TextRange objects that represents the JPQL query string
within the document. The list should contain either one TextRange if the JPQL query is
a single string or many if the JPQL query is split into multiple stringsoffset - This offset is used to move the start positionmessages - The list of IMessages that will be used to add validation problemsescapeCharacters - Determines whether the special characters (\n, \r for instance) should
be escaped or not
|
Dali Provisional API Release 3.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||