You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Donald Woods <dw...@apache.org> on 2010/06/02 18:16:16 UTC

Re: svn commit: r950604 - in /openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql: DB2Dictionary.java DBDictionary.java

Fay, OPENJPA-1596 has already been marked as fixed in 2.0.0-beta3, so
you need to use a new JIRA for any additional changes.

Otherwise, the 2.0.1 release notes will not denote that this change was
included....

-Donald


On 6/2/10 11:42 AM, faywang@apache.org wrote:
> Author: faywang
> Date: Wed Jun  2 15:42:20 2010
> New Revision: 950604
> 
> URL: http://svn.apache.org/viewvc?rev=950604&view=rev
> Log:
> OPENJPA-1596: port the change to 2.0
> 
> Modified:
>     openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
>     openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
> 
> Modified: openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
> URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java?rev=950604&r1=950603&r2=950604&view=diff
> ==============================================================================
> --- openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java (original)
> +++ openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java Wed Jun  2 15:42:20 2010
> @@ -33,6 +33,7 @@ import java.util.Set;
>  import java.util.StringTokenizer;
>  
>  import org.apache.openjpa.jdbc.identifier.DBIdentifier;
> +import org.apache.openjpa.jdbc.identifier.QualifiedDBIdentifier;
>  import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
>  import org.apache.openjpa.jdbc.kernel.exps.FilterValue;
>  import org.apache.openjpa.jdbc.kernel.exps.Lit;
> @@ -912,8 +913,10 @@ public class DB2Dictionary
>              // build the index for the sequence tables
>              // the index name will be the fully qualified table name + _IDX
>              Table tab = schema.getTable(table);
> -            DBIdentifier idxName = DBIdentifier.append(tab.getFullIdentifier(), "IDX");
> -            Index idx = tab.addIndex(getValidIndexName(idxName, tab));
> +            DBIdentifier fullIdxId = tab.getFullIdentifier().clone();
> +            DBIdentifier unQualifiedName = DBIdentifier.append(fullIdxId.getUnqualifiedName(), "IDX");
> +            fullIdxId.setName(getValidIndexName(unQualifiedName, tab));
> +            Index idx = tab.addIndex(fullIdxId);
>              idx.setUnique(true);
>              idx.addColumn(pkColumn);
>          }
> 
> Modified: openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
> URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=950604&r1=950603&r2=950604&view=diff
> ==============================================================================
> --- openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java (original)
> +++ openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java Wed Jun  2 15:42:20 2010
> @@ -3408,8 +3408,13 @@ public class DBDictionary
>          buf.append("CREATE ");
>          if (index.isUnique())
>              buf.append("UNIQUE ");
> -        String indexName = checkNameLength(toDBName(index.getIdentifier()), maxIndexNameLength, 
> +        
> +        DBIdentifier fullIdxName = index.getIdentifier();
> +        DBIdentifier unQualifiedName = fullIdxName.getUnqualifiedName();
> +        checkNameLength(toDBName(unQualifiedName), maxIndexNameLength, 
>                  "long-index-name");
> +        String indexName = toDBName(fullIdxName);
> +         
>          buf.append("INDEX ").append(indexName);
>          buf.append(" ON ").append(getFullName(index.getTable(), false));
>          buf.append(" (").append(namingUtil.appendColumns(index.getColumns())).
> 
> 
>