2
pom.xml
2
pom.xml
@@ -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>
|
||||
|
||||
@@ -93,7 +93,7 @@ class HibernateJpaParametersParameterAccessor extends JpaParametersParameterAcce
|
||||
protected Object potentiallyUnwrap(Object parameterValue) {
|
||||
|
||||
return (parameterValue instanceof TypedParameterValue<?> typedParameterValue) //
|
||||
? typedParameterValue.getValue() //
|
||||
? typedParameterValue.value() //
|
||||
: parameterValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user