Fix Query#getParameters() returning an empty Set when the query has no parameters

This commit is contained in:
Andrea Boriero 2021-12-13 18:59:41 +01:00 committed by Andrea Boriero
parent ba558503a8
commit 6ebceedf48
2 changed files with 5 additions and 2 deletions

View File

@ -177,7 +177,10 @@ public class ProcedureParameterMetadataImpl implements ProcedureParameterMetadat
@Override
public Set<? extends QueryParameter<?>> getRegistrations() {
//noinspection unchecked
return parameters.stream().collect( Collectors.toSet());
if ( parameters == null ) {
return Collections.emptySet();
}
return parameters.stream().collect( Collectors.toSet() );
}
@Override

View File

@ -4,7 +4,7 @@
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.jpa.procedure;
package org.hibernate.orm.test.jpa.procedure;
import jakarta.persistence.Entity;
import jakarta.persistence.EntityManager;