From ea946b96540eac3d29a402f863648f6cb5f1365a Mon Sep 17 00:00:00 2001 From: Michael Dick Date: Tue, 19 Feb 2008 17:32:05 +0000 Subject: [PATCH] OPENJPA-517 git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/1.0.x@629168 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/openjpa/jdbc/sql/DBDictionary.java | 7 ++++++- .../openjpa/jdbc/sql/OracleDictionary.java | 3 +++ .../src/doc/manual/ref_guide_dbsetup.xml | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java index 75cce6653..e4f01bb5b 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java @@ -174,6 +174,7 @@ public class DBDictionary public String reservedWords = null; public String systemSchemas = null; public String systemTables = null; + public String selectWords = null; public String fixedSizeTypeNames = null; public String schemaCase = SCHEMA_CASE_UPPER; @@ -3876,10 +3877,14 @@ public class DBDictionary if (fixedSizeTypeNames != null) fixedSizeTypeNameSet.addAll(Arrays.asList(Strings.split (fixedSizeTypeNames.toUpperCase(), ",", 0))); - + // if user has unset sequence sql, null it out so we know sequences // aren't supported nextSequenceQuery = StringUtils.trimToNull(nextSequenceQuery); + + if (selectWords != null) + selectWordSet.addAll(Arrays.asList(Strings.split(selectWords + .toUpperCase(), ",", 0))); } ////////////////////////////////////// diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java index aa8ed1793..bcc4e9a96 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java @@ -155,6 +155,9 @@ public class OracleDictionary "LONG", "MAXEXTENTS", "MINUS", "MODE", "NOAUDIT", "NOCOMPRESS", "NOWAIT", "OFFLINE", "ONLINE", "PCTFREE", "ROW", })); + + selectWordSet.add("WITH"); + selectWordSet.add("WITH"); } public void endConfiguration() { diff --git a/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml b/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml index a39294bf6..8fe35a5ab 100644 --- a/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml +++ b/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml @@ -1009,6 +1009,22 @@ true. this database, beyond the standard SQL92 keywords. + + + + + SQL + + + SelectWords + + +SelectWords: A comma-separated list of keywords which may be +used to start a SELECT statement for this database. If an application executes +a native SQL statement which begins with SelectWords OpenJPA will treat the +statement as a SELECT statement rather than an UPDATE statement. + +