org.hibernate.query.internal.AbstractQueryParameterImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
Hibernate's core ORM functionality
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.query.internal;
import org.hibernate.metamodel.model.domain.AllowableParameterType;
import org.hibernate.query.QueryParameter;
/**
* QueryParameter implementation.
*
* NOTE: Unfortunately we need to model named and positional parameters separately still until 6.0. For now
* this is simply the base abstract class for those specific impls
*
* @author Steve Ebersole
*/
public abstract class AbstractQueryParameterImpl implements QueryParameter {
private AllowableParameterType expectedType;
public AbstractQueryParameterImpl(AllowableParameterType expectedType) {
this.expectedType = expectedType;
}
@Override
public AllowableParameterType getHibernateType() {
return expectedType;
}
public void setHibernateType(AllowableParameterType expectedType) {
//noinspection unchecked
this.expectedType = (AllowableParameterType) expectedType;
}
@Override
public Class getParameterType() {
return expectedType == null ? null : expectedType.getExpressableJavaTypeDescriptor().getJavaType();
}
}