All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.query.internal.QueryParameterImpl Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha1
Show newest version
/*
 * 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.query.QueryParameter;
import org.hibernate.type.Type;

/**
 * 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 QueryParameterImpl implements QueryParameter {
	private Type expectedType;

	public QueryParameterImpl(Type expectedType) {
		this.expectedType = expectedType;
	}

	@Override
	public Type getHibernateType() {
		return expectedType;
	}

	public void setHibernateType(Type expectedType) {
		this.expectedType = expectedType;
	}

	@Override
	public Class getParameterType() {
		return expectedType == null ? null : expectedType.getReturnedClass();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy