openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1508186 - /openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Date Mon, 29 Jul 2013 19:23:48 GMT
Author: hthomann
Date: Mon Jul 29 19:23:48 2013
New Revision: 1508186

URL: http://svn.apache.org/r1508186
Log:
OPENJPA-2387: Fix to exclude schema name when checking the length of a sequence name.  Made
update to ensure schema is used after length is calculated.

Modified:
    openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java

Modified: openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=1508186&r1=1508185&r2=1508186&view=diff
==============================================================================
--- openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
(original)
+++ openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Mon Jul 29 19:23:48 2013
@@ -3489,8 +3489,12 @@ public class DBDictionary
         StringBuilder buf = new StringBuilder();
         buf.append(create ? "CREATE" : "ALTER").append(" SEQUENCE ");
         
-        String seqName = checkNameLength(toDBName(seq.getFullIdentifier().getUnqualifiedName()),

+        //Strip off the schema and verify the sequence name is within the legal length, NOT
+        //the schema name + sequence name.
+        checkNameLength(toDBName(seq.getFullIdentifier().getUnqualifiedName()), 
             maxTableNameLength, "long-seq-name");
+        //Now use the full sequence name (schema + sequence name).
+        String seqName = getFullName(seq);
 
         buf.append(seqName);
         if (create && seq.getInitialValue() != 0)



Mime
View raw message