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:27:28 UTC
svn commit: r1508188 - in /openjpa/trunk: ./
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Author: hthomann
Date: Mon Jul 29 19:27:27 2013
New Revision: 1508188
URL: http://svn.apache.org/r1508188
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/trunk/ (props changed)
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Propchange: openjpa/trunk/
------------------------------------------------------------------------------
Merged /openjpa/branches/2.2.1.x:r1508186
Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=1508188&r1=1508187&r2=1508188&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java Mon Jul 29 19:27:27 2013
@@ -3484,8 +3484,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)