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

org.hibernate.query.spi.QueryParameterBinding Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha3
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.spi;

import java.util.Collection;
import javax.persistence.TemporalType;

import org.hibernate.Incubating;
import org.hibernate.metamodel.model.domain.AllowableParameterType;
import org.hibernate.type.spi.TypeConfiguration;

/**
 /**
 * The value/type binding information for a particular query parameter.  Supports
 * both single-valued and multi-valued binds
 *
 * @author Steve Ebersole
 */
@Incubating
public interface QueryParameterBinding {
	/**
	 * Is any value (including {@code null}) bound?  Asked another way,
	 * were any of the `#set` methods called?
	 */
	boolean isBound();

	/**
	 * Is the binding multi-valued?
	 */
	boolean isMultiValued();

	/**
	 * Get the Type currently associated with this binding.
	 *
	 * @return The currently associated Type
	 */
	AllowableParameterType getBindType();

	/**
	 * If the parameter represents a temporal type, return the explicitly
	 * specified precision - if one.
	 */
	TemporalType getExplicitTemporalPrecision();

	/**
	 * Sets the parameter binding value.  The inherent parameter type (if known) is assumed
	 */
	void setBindValue(T value);

	/**
	 * Sets the parameter binding value using the explicit Type.
	 *
	 * @param value The bind value
	 * @param clarifiedType The explicit Type to use
	 */
	void setBindValue(T value, AllowableParameterType clarifiedType);

	/**
	 * Sets the parameter binding value using the explicit TemporalType.
	 *
	 * @param value The bind value
	 * @param temporalTypePrecision The temporal type to use
	 */
	void setBindValue(T value, TemporalType temporalTypePrecision);

	/**
	 * Get the value current bound.
	 *
	 * @return The currently bound value
	 */
	T getBindValue();

	/**
	 * Sets the parameter binding values.  The inherent parameter type (if known) is assumed in regards to the
	 * individual values.
	 *
	 * @param values The bind values
	 */
	void setBindValues(Collection values);

	/**
	 * Sets the parameter binding values using the explicit Type in regards to the individual values.
	 *
	 * @param values The bind values
	 * @param clarifiedType The explicit Type to use
	 */
	void setBindValues(Collection values, AllowableParameterType clarifiedType);

	/**Sets the parameter binding value using the explicit TemporalType in regards to the individual values.
	 *
	 *
	 * @param values The bind values
	 * @param temporalTypePrecision The temporal type to use
	 */
	void setBindValues(Collection values, TemporalType temporalTypePrecision, TypeConfiguration typeConfiguration);

	/**
	 * Get the values currently bound.
	 *
	 * @return The currently bound values
	 */
	Collection getBindValues();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy