HHH-14380 - Only reorder destination from elements from the same from clause

This commit is contained in:
Christian Beikov 2020-12-19 14:34:46 +01:00
parent c1baa23734
commit 89f0000b62

View File

@ -95,8 +95,12 @@ void moveFromElementToEnd(FromElement element) {
fromElements.remove( element );
fromElements.add( element );
// We must move destinations which must come after the from element as well
fromElements.removeAll( element.getDestinations() );
fromElements.addAll( element.getDestinations() );
for ( FromElement fromElement : element.getDestinations() ) {
if ( this == fromElement.getFromClause() ) {
fromElements.remove( fromElement );
fromElements.add( fromElement );
}
}
}
public void finishInit() {