You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by ht...@apache.org on 2013/07/29 21:23:48 UTC
svn commit: r1508186 -
/openjpa/branches/2.2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
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)