HHH-4688 Make sure @OrderBy works for @ElementCollection. Handle default case
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18419 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
bd6a77a0dc
commit
71d9459a20
|
@ -1243,7 +1243,8 @@ public abstract class CollectionBinder {
|
||||||
element.setFetchMode( FetchMode.JOIN );
|
element.setFetchMode( FetchMode.JOIN );
|
||||||
element.setLazy( false );
|
element.setLazy( false );
|
||||||
element.setIgnoreNotFound( ignoreNotFound );
|
element.setIgnoreNotFound( ignoreNotFound );
|
||||||
if ( StringHelper.isNotEmpty( hqlOrderBy ) ) {
|
// as per 11.1.38 of JPA-2 spec, default to primary key if no column is specified by @OrderBy.
|
||||||
|
if ( hqlOrderBy != null ) {
|
||||||
collValue.setManyToManyOrdering(
|
collValue.setManyToManyOrdering(
|
||||||
buildOrderByClauseFromHql( hqlOrderBy, collectionEntity, collValue.getRole() )
|
buildOrderByClauseFromHql( hqlOrderBy, collectionEntity, collValue.getRole() )
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue