mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-09 20:54:46 +00:00
HHH-17201 Unexpected value type exception for unordered multi id Load with ordered return disable
This commit is contained in:
parent
8c1e3c3f14
commit
f21cc53d28
@ -6,6 +6,7 @@
|
||||
*/
|
||||
package org.hibernate.internal;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@ -15,6 +16,7 @@
|
||||
import org.hibernate.graph.GraphSemantic;
|
||||
import org.hibernate.graph.RootGraph;
|
||||
import org.hibernate.graph.spi.RootGraphImplementor;
|
||||
import org.hibernate.loader.ast.internal.LoaderHelper;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
import org.hibernate.loader.ast.spi.MultiIdLoadOptions;
|
||||
|
||||
@ -165,6 +167,13 @@ public List<T> perform(Supplier<List<T>> executor) {
|
||||
@Override
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public <K> List<T> multiLoad(List<K> ids) {
|
||||
return perform( () -> (List<T>) entityPersister.multiLoad( ids.toArray( new Object[ 0 ] ), session, this ) );
|
||||
if ( ids.isEmpty() ) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return perform( () -> (List<T>) entityPersister.multiLoad(
|
||||
ids.toArray( LoaderHelper.createTypedArray( ids.get( 0 ).getClass(), ids.size() ) ),
|
||||
session,
|
||||
this
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user