HHH-12695 Rename org.hibernate.query.QueryParameter#getType to getHibernateType

Because it conflicts with the Class-returning getType method we want to
re-introduce in ParameterRegistration to restore backward compatibility.
This commit is contained in:
Yoann Rodière 2018-07-04 09:36:18 +02:00 committed by Guillaume Smet
parent 99c0c320bb
commit e9b8a80a99
7 changed files with 9 additions and 13 deletions

View File

@ -42,7 +42,7 @@ public abstract class AbstractParameterDescriptor implements QueryParameter {
} }
@Override @Override
public Type getType() { public Type getHibernateType() {
return getExpectedType(); return getExpectedType();
} }

View File

@ -34,6 +34,7 @@ public interface ParameterRegistrationImplementor<T> extends ParameterRegistrati
* *
* @return The Hibernate Type * @return The Hibernate Type
*/ */
@Override
Type getHibernateType(); Type getHibernateType();
/** /**

View File

@ -21,7 +21,7 @@ public interface QueryParameter<T> extends javax.persistence.Parameter<T> {
* *
* @return The Hibernate Type. * @return The Hibernate Type.
*/ */
Type getType(); Type getHibernateType();
int[] getSourceLocations(); int[] getSourceLocations();

View File

@ -840,7 +840,7 @@ public abstract class AbstractProducedQuery<R> implements QueryImplementor<R> {
protected Type determineType(String namedParam, Class retType) { protected Type determineType(String namedParam, Class retType) {
Type type = getQueryParameterBindings().getBinding( namedParam ).getBindType(); Type type = getQueryParameterBindings().getBinding( namedParam ).getBindType();
if ( type == null ) { if ( type == null ) {
type = getParameterMetadata().getQueryParameter( namedParam ).getType(); type = getParameterMetadata().getQueryParameter( namedParam ).getHibernateType();
} }
if ( type == null ) { if ( type == null ) {
type = getProducer().getFactory().resolveParameterBindType( retType ); type = getProducer().getFactory().resolveParameterBindType( retType );

View File

@ -119,7 +119,7 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
); );
} }
final QueryParameterBinding binding = makeBinding( queryParameter.getType() ); final QueryParameterBinding binding = makeBinding( queryParameter.getHibernateType() );
parameterBindingMap.put( queryParameter, binding ); parameterBindingMap.put( queryParameter, binding );
return binding; return binding;
@ -145,7 +145,7 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
return parameterListBindingMap.computeIfAbsent( return parameterListBindingMap.computeIfAbsent(
param, param,
p -> new QueryParameterListBindingImpl( p -> new QueryParameterListBindingImpl(
param.getType(), param.getHibernateType(),
shouldValidateBindingValue() shouldValidateBindingValue()
) )
); );
@ -606,7 +606,7 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
syntheticParam = new NamedParameterDescriptor( syntheticParam = new NamedParameterDescriptor(
syntheticName, syntheticName,
sourceParam.getType(), sourceParam.getHibernateType(),
sourceParam.getSourceLocations() sourceParam.getSourceLocations()
); );
} }
@ -624,7 +624,7 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
syntheticParam = new OrdinalParameterDescriptor( syntheticParam = new OrdinalParameterDescriptor(
syntheticPosition, syntheticPosition,
syntheticPosition - jdbcStyleOrdinalCountBase, syntheticPosition - jdbcStyleOrdinalCountBase,
sourceParam.getType(), sourceParam.getHibernateType(),
sourceParam.getSourceLocations() sourceParam.getSourceLocations()
); );
} }

View File

@ -25,7 +25,7 @@ public abstract class QueryParameterImpl<T> implements QueryParameter<T> {
} }
@Override @Override
public Type getType() { public Type getHibernateType() {
return expectedType; return expectedType;
} }

View File

@ -118,11 +118,6 @@ public class ProcedureParameterImpl<T>
return position; return position;
} }
@Override
public Type getHibernateType() {
return getType();
}
@Override @Override
public void setHibernateType(Type expectedType) { public void setHibernateType(Type expectedType) {
super.setHibernateType( expectedType ); super.setHibernateType( expectedType );