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 c26ac23a7b
commit 68ad2130e8
7 changed files with 9 additions and 13 deletions

View File

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

View File

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

View File

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

View File

@ -840,7 +840,7 @@ public abstract class AbstractProducedQuery<R> implements QueryImplementor<R> {
protected Type determineType(String namedParam, Class retType) {
Type type = getQueryParameterBindings().getBinding( namedParam ).getBindType();
if ( type == null ) {
type = getParameterMetadata().getQueryParameter( namedParam ).getType();
type = getParameterMetadata().getQueryParameter( namedParam ).getHibernateType();
}
if ( type == null ) {
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 );
return binding;
@ -145,7 +145,7 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
return parameterListBindingMap.computeIfAbsent(
param,
p -> new QueryParameterListBindingImpl(
param.getType(),
param.getHibernateType(),
shouldValidateBindingValue()
)
);
@ -606,7 +606,7 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
syntheticParam = new NamedParameterDescriptor(
syntheticName,
sourceParam.getType(),
sourceParam.getHibernateType(),
sourceParam.getSourceLocations()
);
}
@ -624,7 +624,7 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
syntheticParam = new OrdinalParameterDescriptor(
syntheticPosition,
syntheticPosition - jdbcStyleOrdinalCountBase,
sourceParam.getType(),
sourceParam.getHibernateType(),
sourceParam.getSourceLocations()
);
}

View File

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

View File

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