Changeset 6669


Ignore:
Timestamp:
Dec 18, 2014, 3:31:27 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #1742: Upgrade to Hibernate 4.x

Fixes an issue with non-unique index names on PostgreSQL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.4-stable/src/core/net/sf/basedb/core/hibernate/DbIndexWork.java

    r6668 r6669  
    2626import java.sql.SQLException;
    2727import java.sql.Statement;
    28 import java.util.HashSet;
    2928import java.util.Iterator;
    3029import java.util.List;
    3130import java.util.Set;
     31import java.util.TreeSet;
    3232
    3333import org.hibernate.cfg.Configuration;
     
    247247       
    248248        List<IndexInfo> existingIndexes = tiDb.findAll(ii.getColumns());
    249         Set<String> duplicateNames = new HashSet<String>();
     249        Set<String> duplicateNames = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
    250250        //String dbName = tiDb.findIndexName(ii.getName(), ii.getColumns());
    251251        boolean exists = existingIndexes.size() > 0;
     
    279279        String createSql =
    280280          dbEngine.getCreateIndexSql(catalog, schema,
    281             table.getName(), ii.getName(),
     281            table.getName(), dbName == null ? table.getName() + "_" + ii.getName() : dbName,
    282282          ii.getColumns(), ii.isUnique());
    283283        boolean actionDrop = dropIndexes && exists && safeToDrop;
Note: See TracChangeset for help on using the changeset viewer.