mirror of https://github.com/apache/openjpa.git
OPENJPA-1596: port the change to 2.0
git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/2.0.x@950604 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ebd07c943a
commit
65bf030d71
|
@ -33,6 +33,7 @@ import java.util.Set;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import org.apache.openjpa.jdbc.identifier.DBIdentifier;
|
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.JDBCFetchConfiguration;
|
||||||
import org.apache.openjpa.jdbc.kernel.exps.FilterValue;
|
import org.apache.openjpa.jdbc.kernel.exps.FilterValue;
|
||||||
import org.apache.openjpa.jdbc.kernel.exps.Lit;
|
import org.apache.openjpa.jdbc.kernel.exps.Lit;
|
||||||
|
@ -912,8 +913,10 @@ public class DB2Dictionary
|
||||||
// build the index for the sequence tables
|
// build the index for the sequence tables
|
||||||
// the index name will be the fully qualified table name + _IDX
|
// the index name will be the fully qualified table name + _IDX
|
||||||
Table tab = schema.getTable(table);
|
Table tab = schema.getTable(table);
|
||||||
DBIdentifier idxName = DBIdentifier.append(tab.getFullIdentifier(), "IDX");
|
DBIdentifier fullIdxId = tab.getFullIdentifier().clone();
|
||||||
Index idx = tab.addIndex(getValidIndexName(idxName, tab));
|
DBIdentifier unQualifiedName = DBIdentifier.append(fullIdxId.getUnqualifiedName(), "IDX");
|
||||||
|
fullIdxId.setName(getValidIndexName(unQualifiedName, tab));
|
||||||
|
Index idx = tab.addIndex(fullIdxId);
|
||||||
idx.setUnique(true);
|
idx.setUnique(true);
|
||||||
idx.addColumn(pkColumn);
|
idx.addColumn(pkColumn);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3408,8 +3408,13 @@ public class DBDictionary
|
||||||
buf.append("CREATE ");
|
buf.append("CREATE ");
|
||||||
if (index.isUnique())
|
if (index.isUnique())
|
||||||
buf.append("UNIQUE ");
|
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");
|
"long-index-name");
|
||||||
|
String indexName = toDBName(fullIdxName);
|
||||||
|
|
||||||
buf.append("INDEX ").append(indexName);
|
buf.append("INDEX ").append(indexName);
|
||||||
buf.append(" ON ").append(getFullName(index.getTable(), false));
|
buf.append(" ON ").append(getFullName(index.getTable(), false));
|
||||||
buf.append(" (").append(namingUtil.appendColumns(index.getColumns())).
|
buf.append(" (").append(namingUtil.appendColumns(index.getColumns())).
|
||||||
|
|
Loading…
Reference in New Issue