本文整理汇总了Java中org.hibernate.mapping.Table.getIndexIterator方法的典型用法代码示例。如果您正苦于以下问题:Java Table.getIndexIterator方法的具体用法?Java Table.getIndexIterator怎么用?Java Table.getIndexIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.mapping.Table
的用法示例。
在下文中一共展示了Table.getIndexIterator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addIndexSQL
import org.hibernate.mapping.Table; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked"})
private void addIndexSQL(List<String> sqlStrings, Table table, Set<Column> colSet)
{
Iterator<Index> indexIterator = table.getIndexIterator();
while( indexIterator.hasNext() )
{
Index index = indexIterator.next();
Iterator<Column> colIter = index.getColumnIterator();
boolean found = false;
while( colIter.hasNext() )
{
Column col = colIter.next();
if( colSet.contains(col) )
{
found = true;
break;
}
}
if( found && (!extDialect.supportsAutoIndexForUniqueColumn() || !hasUniqueIndex(index, table)) )
{
sqlStrings.add(index.sqlCreateString(dialect, mapping, defaultCatalog, defaultSchema));
}
}
}
示例2: getAddIndexesIfRequired
import org.hibernate.mapping.Table; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Collection<? extends String> getAddIndexesIfRequired(Session session, String tableName, String... indexes)
{
final Table table = findTable(tableName);
List<String> sqlStrings = new ArrayList<String>();
Map<Set<String>, String> revIndexMap = getExistingIndexes(table, session);
Set<String> indexSet = new HashSet<String>(Arrays.asList(indexes));
Iterator<Index> indexIterator = table.getIndexIterator();
while( indexIterator.hasNext() )
{
Index index = indexIterator.next();
if( !indexSet.remove(index.getName()) )
{
continue;
}
processIndex(table, index, revIndexMap, sqlStrings);
}
if( !indexSet.isEmpty() )
{
throw new RuntimeException("Failed to find indexes:" + indexSet + " on table: " + tableName);
}
return sqlStrings;
}