Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ public CommonQueryContract setParameter(String name, Object value) {
final QueryParameter<Object> param = binding.getQueryParameter();
if ( param.allowsMultiValuedBinding() ) {
final BindableType<?> hibernateType = param.getHibernateType();
if ( hibernateType == null || isInstance( hibernateType, value ) ) {
if ( hibernateType == null || value == null || isInstance( hibernateType, value ) ) {
if ( value instanceof Collection && !isRegisteredAsBasicType( value.getClass() ) ) {
//noinspection rawtypes
return setParameterList( name, (Collection) value );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2386,10 +2386,15 @@
session.createQuery("select 1 where 1 in :list", Integer.class)
.setParameterList("list",List.of())
.list().size() );
assertEquals( 0,
session.createQuery( "select e from EntityWithOneToOne e where e.other in (:list)" )

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
.setParameter( "list", null )
.list().size() );
}
);
}


@Test
public void testMaxGreatest(SessionFactoryScope scope) {
scope.inTransaction(
Expand Down
Loading