From 2e54d957077b6174a5258049f400c06912f38812 Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Mon, 9 Sep 2024 15:21:35 +0800 Subject: [PATCH] HHH-18575 Add test for issue --- .../test/query/hql/MultiValuedParameterTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/MultiValuedParameterTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/MultiValuedParameterTest.java index a083fbcd3a..569e6bf300 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/MultiValuedParameterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/MultiValuedParameterTest.java @@ -6,6 +6,7 @@ */ package org.hibernate.orm.test.query.hql; +import java.math.BigDecimal; import java.math.BigInteger; import java.time.LocalDate; import java.util.ArrayList; @@ -28,6 +29,7 @@ import jakarta.persistence.Id; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author Andrea Boriero @@ -102,6 +104,20 @@ public class MultiValuedParameterTest extends BaseSessionFactoryFunctionalTest { } ); } + @Test + @Jira( "https://hibernate.atlassian.net/browse/HHH-18575" ) + void testMultiValuedBigDecimals() { + inTransaction( session -> { + assertEquals( + 1, + session.createQuery("SELECT 1 WHERE :value IN (:list)", Integer.class) + .setParameter( "value", BigDecimal.valueOf( 2.0)) + .setParameter("list", List.of(BigDecimal.valueOf(2.0), BigDecimal.valueOf(3.0))) + .getSingleResult() + ); + }); + } + @AfterAll public void cleanupData() { inTransaction( session -> {