Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNan Li2013-08-20 22:30:47 -0400
committerNan Li2013-08-20 22:30:47 -0400
commit5ac0c653bf19851157f2a56858d97adbb362590b (patch)
tree87a8d61cae9e876c280d87846af5e6ff44ba8fa9
parent4b3801a37fc66f5a0fdd3c4010688ba6fd70093e (diff)
downloadwebtools.dali-5ac0c653bf19851157f2a56858d97adbb362590b.tar.gz
webtools.dali-5ac0c653bf19851157f2a56858d97adbb362590b.tar.xz
webtools.dali-5ac0c653bf19851157f2a56858d97adbb362590b.zip
409120 - Missing validation switch for JOIN FETCH
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpql/JpaJpqlQueryHelper.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpql/JpaJpqlQueryHelper.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpql/JpaJpqlQueryHelper.java
index a376b4be8e..49407f5cdd 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpql/JpaJpqlQueryHelper.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpql/JpaJpqlQueryHelper.java
@@ -192,7 +192,8 @@ public abstract class JpaJpqlQueryHelper extends AbstractJPQLQueryHelper {
String jpqlQuery,
String actualJpqlQuery,
int offset,
- EscapeType escapeType) {
+ EscapeType escapeType,
+ int severity) {
// Convert the positions from the parsed JPQL query to the actual JPQL query
int[] positions = buildPositions(problem, parsedJpqlQuery, jpqlQuery, actualJpqlQuery, offset, escapeType);
@@ -229,7 +230,7 @@ public abstract class JpaJpqlQueryHelper extends AbstractJPQLQueryHelper {
// Create the validation message
IMessage message = new Message(
"jpt_jpa_core_jpql_validation",
- IMessage.HIGH_SEVERITY,
+ severity,
problem.getMessageKey(),
problem.getMessageArguments(),
namedQuery.getResource()
@@ -303,10 +304,6 @@ public abstract class JpaJpqlQueryHelper extends AbstractJPQLQueryHelper {
super.setQuery(query);
}
- protected boolean shouldValidate(NamedQuery namedQuery) {
- return this.getValidationSeverity(namedQuery) != ValidationMessage.IGNORE_SEVERITY;
- }
-
/**
* Validates the given {@link NamedQuery} by validating the JPQL query.
*
@@ -330,8 +327,9 @@ public abstract class JpaJpqlQueryHelper extends AbstractJPQLQueryHelper {
List<IMessage> messages) {
try {
+ int severity = this.getValidationSeverity(namedQuery);
// Make this quick check so we don't validate the query, which is time consuming
- if (shouldValidate(namedQuery)) {
+ if (severity != ValidationMessage.IGNORE_SEVERITY) {
setQuery(namedQuery, jpqlQuery);
String parsedJpqlQuery = getParsedJPQLQuery();
@@ -346,7 +344,8 @@ public abstract class JpaJpqlQueryHelper extends AbstractJPQLQueryHelper {
jpqlQuery,
actualJpqlQuery,
offset,
- escapeType
+ escapeType,
+ severity
);
messages.addAll(results);

Back to the top