Skip to content

Commit

Permalink
Set comparator on Persistent SortedSet and SortedMap collection insta…
Browse files Browse the repository at this point in the history
…nces
  • Loading branch information
Naros authored and beikov committed Mar 12, 2021
1 parent 4292d11 commit 71f633a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -49,7 +49,9 @@ public PersistentCollection<V> instantiateWrapper(
Object key,
CollectionPersister collectionDescriptor,
SharedSessionContractImplementor session) {
return new PersistentSortedMap<>( session );
final PersistentSortedMap<K,V> result = new PersistentSortedMap<>( session );
result.setComparator( (Comparator<K>) collectionDescriptor.getSortingComparator() );
return result;
}

@Override
Expand Down
Expand Up @@ -50,7 +50,9 @@ public PersistentCollection<E> instantiateWrapper(
Object key,
CollectionPersister collectionDescriptor,
SharedSessionContractImplementor session) {
return new PersistentSortedSet<>( session );
final PersistentSortedSet<E> result = new PersistentSortedSet<>( session );
result.setComparator( (Comparator<E>) collectionDescriptor.getSortingComparator() );
return result;
}

@Override
Expand Down

0 comments on commit 71f633a

Please sign in to comment.