diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java index 92b1ed7c9..aa447ecec 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java @@ -3165,10 +3165,10 @@ public class DBDictionary buf.append("CREATE "); if (index.isUnique()) buf.append("UNIQUE "); - buf.append("INDEX ").append(index.getName()); - String indexName = checkNameLength(getFullName(index.getTable(), false), - maxIndexNameLength, "long-index-name"); - buf.append(" ON ").append(indexName); + String indexName = checkNameLength(index.getName(), maxIndexNameLength, + "long-index-name"); + buf.append("INDEX ").append(indexName); + buf.append(" ON ").append(getFullName(index.getTable(), false)); buf.append(" (").append(Strings.join(index.getColumns(), ", ")). append(")");