HHH-11913 : Schema generation ignores index DESC/ASC order

This commit is contained in:
Andrea Boriero 2017-11-21 16:56:07 +00:00 committed by Steve Ebersole
parent 8b313976d9
commit 5111a468c4
1 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,7 @@
package org.hibernate.tool.schema.internal;
import java.util.Iterator;
import java.util.Map;
import org.hibernate.boot.Metadata;
import org.hibernate.boot.model.relational.QualifiedNameImpl;
@ -57,7 +58,8 @@ public class StandardIndexExporter implements Exporter<Index> {
.append( " (" );
boolean first = true;
Iterator<Column> columnItr = index.getColumnIterator();
final Iterator<Column> columnItr = index.getColumnIterator();
final Map<Column, String> columnOrderMap = index.getColumnOrderMap();
while ( columnItr.hasNext() ) {
final Column column = columnItr.next();
if ( first ) {
@ -67,6 +69,9 @@ public class StandardIndexExporter implements Exporter<Index> {
buf.append( ", " );
}
buf.append( ( column.getQuotedName( dialect ) ) );
if ( columnOrderMap.containsKey( column ) ) {
buf.append( " " ).append( columnOrderMap.get( column ) );
}
}
buf.append( ")" );
return new String[] { buf.toString() };