Upgrade to Hibernate 7.0 CR2.

Closes #3887
This commit is contained in:
Mark Paluch
2025-05-15 11:50:04 +02:00
parent eeca4df36f
commit 438de0c2e0
3 changed files with 9 additions and 9 deletions

View File

@@ -30,7 +30,7 @@
<antlr>4.13.2</antlr> <!-- align with Hibernate's parser -->
<eclipselink>5.0.0-B07</eclipselink>
<eclipselink-next>5.0.0-SNAPSHOT</eclipselink-next>
<hibernate>7.0.0.CR1</hibernate>
<hibernate>7.0.0.CR2</hibernate>
<hibernate-70-snapshots>7.0.0-SNAPSHOT</hibernate-70-snapshots>
<hsqldb>2.7.4</hsqldb>
<h2>2.3.232</h2>

View File

@@ -93,7 +93,7 @@ class HibernateJpaParametersParameterAccessor extends JpaParametersParameterAcce
protected Object potentiallyUnwrap(Object parameterValue) {
return (parameterValue instanceof TypedParameterValue<?> typedParameterValue) //
? typedParameterValue.getValue() //
? typedParameterValue.value() //
: parameterValue;
}
}

View File

@@ -51,6 +51,7 @@ class JpaParametersParameterAccessorTests {
}
@Test // GH-2370
@SuppressWarnings({ "rawtypes", "unchecked" })
void createsHibernateParametersParameterAccessor() throws Exception {
Method withNativeQuery = SampleRepository.class.getMethod("withNativeQuery", Integer.class);
@@ -63,18 +64,17 @@ class JpaParametersParameterAccessorTests {
ArgumentCaptor<TypedParameterValue<?>> captor = ArgumentCaptor.forClass(TypedParameterValue.class);
verify(query).setParameter(eq(1), captor.capture());
TypedParameterValue<?> captorValue = captor.getValue();
assertThat(captorValue.getType().getBindableJavaType()).isEqualTo(Integer.class);
assertThat(captorValue.type().getJavaType()).isEqualTo(Integer.class);
assertThat(captorValue.getValue()).isNull();
}
private void bind(JpaParameters parameters, JpaParametersParameterAccessor accessor) {
ParameterBinderFactory.createBinder(parameters, true)
.bind( //
QueryParameterSetter.BindableQuery.from(query), //
accessor, //
QueryParameterSetter.ErrorHandling.LENIENT //
);
ParameterBinderFactory.createBinder(parameters, true).bind( //
QueryParameterSetter.BindableQuery.from(query), //
accessor, //
QueryParameterSetter.ErrorHandling.LENIENT //
);
}
interface SampleRepository {