[teiid-commits] teiid SVN: r2917 - in trunk/engine/src/main: resources/org/teiid/query and 1 other directory.
teiid-commits at lists.jboss.org
teiid-commits at lists.jboss.org
Thu Feb 17 13:55:02 EST 2011
Author: shawkins
Date: 2011-02-17 13:55:02 -0500 (Thu, 17 Feb 2011)
New Revision: 2917
Modified:
trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidator.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
Log:
TEIIDDES-806 updating validation logic and messages
Modified: trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidator.java 2011-02-17 18:52:11 UTC (rev 2916)
+++ trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidator.java 2011-02-17 18:55:02 UTC (rev 2917)
@@ -56,8 +56,6 @@
* the virtual group is always a <code>Query</code>. This object visits various parts of
* this <code>Query</code> and verifies if the virtual group definition will allows it to be
* updated.</p>
- *
- * TODO: add insert support based upon partitioning
*/
public class UpdateValidator {
@@ -428,7 +426,9 @@
}
if (query.getFrom().getClauses().size() > 1 || (!(query.getFrom().getClauses().get(0) instanceof UnaryFromClause))) {
- report.handleValidationWarning(QueryPlugin.Util.getString("ERR.015.012.0009", query.getFrom())); //$NON-NLS-1$
+ String warning = QueryPlugin.Util.getString("ERR.015.012.0009", query.getFrom());
+ updateReport.handleValidationWarning(warning); //$NON-NLS-1$
+ deleteReport.handleValidationWarning(warning); //$NON-NLS-1$
updateInfo.isSimple = false;
}
List<GroupSymbol> allGroups = query.getFrom().getGroups();
@@ -445,15 +445,14 @@
if (!allGroups.isEmpty()) {
setUpdateFlags(allGroups.iterator().next());
}
- } else if (this.updateInfo.updateType == UpdateType.INHERENT || this.updateInfo.deleteType == UpdateType.INHERENT) {
+ } else {
for (GroupSymbol groupSymbol : allGroups) {
UpdateMapping info = updateInfo.updatableGroups.get(groupSymbol.getCanonicalName());
if (info == null) {
continue; // not projected
}
- String warning = QueryPlugin.Util.getString("ERR.015.012.0004"); //$NON-NLS-1$
- updateReport.handleValidationWarning(warning);
- deleteReport.handleValidationWarning(warning);
+ String warning = QueryPlugin.Util.getString("ERR.015.012.0004", info.correlatedName); //$NON-NLS-1$
+ report.handleValidationWarning(warning);
}
}
@@ -475,7 +474,7 @@
handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0015"), false, true, false); //$NON-NLS-1$
}
if (this.updateInfo.updateType == UpdateType.INHERENT && !updatable) {
- handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0005"), true, false, true); //$NON-NLS-1$
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0005"), true, false, false); //$NON-NLS-1$
}
if (this.updateInfo.deleteType == UpdateType.INHERENT && this.updateInfo.deleteTarget == null) {
if (this.updateInfo.isSimple && updatable) {
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-02-17 18:52:11 UTC (rev 2916)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-02-17 18:55:02 UTC (rev 2917)
@@ -161,16 +161,16 @@
# util (011)
# validator (012)
-ERR.015.012.0001 = The query defining an updatable view must be a simple query or a UNION ALL of simple queries.
-ERR.015.012.0002 = The query defining an updatable view has a WITH clause, pass-through processing will not be used for UPDATE/DELETE operations.
-ERR.015.012.0003 = The query defining an updatable view projects a column from a non-updatable group {0}.
-ERR.015.012.0004 = The query defining an updatable view has a non key preserving join group {0}, which cannot be targeted by UPDATE/DELETE operations.
-ERR.015.012.0005 = The query defining an updatable view has no valid target for UPDATEs.
-ERR.015.012.0006 = The query defining an updatable view should not use aggregates or grouping.
-ERR.015.012.0007 = The query defining an updatable view has a non-updatable expression {0} for view column {1}.
-ERR.015.012.0008 = The query defining an updatable view cannot use SELECT DISTINCT.
-ERR.015.012.0009 = The query defining an updatable view has a non-simple FROM clause, pass-through processing will not be used for UPDATE/DELETE operations.
-ERR.015.012.0010 = The query defining an updatable view does not project the column {0}, which is required to make {1} a target of INSERT operations.
+ERR.015.012.0001 = The updatable view query must be simple (containing a FROM clause and not using SELECT INTO) or a UNION ALL of simple queries.
+ERR.015.012.0002 = The updatable view query has a WITH clause, pass-through processing will not be used for UPDATE/DELETE operations.
+ERR.015.012.0003 = The updatable view query projects a column from a non-updatable group {0}.
+ERR.015.012.0004 = The updatable view query has a non key preserving group {0}, which cannot be targeted by INSERT/UPDATE/DELETE operations.
+ERR.015.012.0005 = The updatable view has no valid target for UPDATEs.
+ERR.015.012.0006 = The updatable view query must not use aggregates or grouping.
+ERR.015.012.0007 = The updatable view query has a non-updatable expression {0} for view column {1}.
+ERR.015.012.0008 = The updatable view query cannot use SELECT DISTINCT.
+ERR.015.012.0009 = The updatable view query has a join, pass-through processing will not be used for UPDATE/DELETE operations.
+ERR.015.012.0010 = The updatable view query does not project the column {0}, which is required to make {1} a target of INSERT operations.
ERR.015.012.0011 = There must be exactly one projected symbol in the subcommand of an IN clause.
ERR.015.012.0012 = An AssignmentStatement cannot change the value of a {0} or {1} variable.
ERR.015.012.0013 = The query defining an updatable virtual group cannot use LIMIT.
@@ -799,6 +799,7 @@
TextTableNode.character_not_allowed=Text parse error: Non-whitespace character found between the qualifier and the delimiter in text line {0} in {1}.
TextTableNode.unknown_escape=Text parse error: Unknown escape sequence \\{0} in text line {1} in {2}.
TextTableNode.invalid_width=Text parse error: Fixed width line width {0} is smaller than the expected {1} on text line {2} in {3}.
+TextTableNode.line_too_long=Text parse error: Delimited line is longer than the expected max of {2} on text line {0} in {1}.
XMLTableNode.error=Error evaluating XQuery row context for XMLTable: {0}
XMLTableNode.path_error=Error evaluating XMLTable column path expression for column: {0}
More information about the teiid-commits
mailing list