HHH-10839 Restore some lost backwards compatibility (#1418)

* HHH-10839 Restore some more selected deprecated APIs

* HHH-10839 Restore backwards compatibility for org.hibernate.Query contract

* HHH-10839 Missing override in the new org.hibernate.query.Query interface
This commit is contained in:
Sanne Grinovero 2016-06-21 19:09:10 +01:00 committed by Steve Ebersole
parent b11d10d742
commit 59a3b4587e
6 changed files with 188 additions and 127 deletions

View File

@ -22,6 +22,7 @@ import javax.persistence.Parameter;
import javax.persistence.TemporalType;
import javax.persistence.TypedQuery;
import org.hibernate.query.CommonQueryContract;
import org.hibernate.query.ParameterMetadata;
import org.hibernate.query.QueryParameter;
import org.hibernate.transform.ResultTransformer;
@ -54,7 +55,7 @@ import org.hibernate.type.Type;
*/
@Deprecated
@SuppressWarnings("UnusedDeclaration")
public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R> {
public interface Query<R> extends TypedQuery<R>, CommonQueryContract {
/**
* Get the query string.
@ -83,9 +84,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
* @see #getHibernateFlushMode()
*/
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setHibernateFlushMode(FlushMode flushMode) {
default Query<R> setHibernateFlushMode(FlushMode flushMode) {
setFlushMode( flushMode );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -100,7 +101,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
* @deprecated (since 5.2) use {@link #setHibernateFlushMode} instead
*/
@Deprecated
org.hibernate.query.Query<R> setFlushMode(FlushMode flushMode);
Query<R> setFlushMode(FlushMode flushMode);
/**
* For users of the Hibernate native APIs, we've had to rename this method
@ -135,7 +136,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @see #getCacheMode()
*/
org.hibernate.query.Query<R> setCacheMode(CacheMode cacheMode);
Query<R> setCacheMode(CacheMode cacheMode);
/**
* Are the results of this query eligible for second level query caching? This is different that second level
@ -160,7 +161,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @see #isCacheable
*/
org.hibernate.query.Query<R> setCacheable(boolean cacheable);
Query<R> setCacheable(boolean cacheable);
/**
* Obtain the name of the second level query cache region in which query results will be stored (if they are
@ -182,7 +183,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @see #getCacheRegion()
*/
org.hibernate.query.Query<R> setCacheRegion(String cacheRegion);
Query<R> setCacheRegion(String cacheRegion);
/**
* Obtain the query timeout <b>in seconds</b>. This value is eventually passed along to the JDBC query via
@ -207,7 +208,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @see #getTimeout()
*/
org.hibernate.query.Query<R> setTimeout(int timeout);
Query<R> setTimeout(int timeout);
/**
* Obtain the JDBC fetch size hint in effect for this query. This value is eventually passed along to the JDBC
@ -233,7 +234,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @see #getFetchSize()
*/
org.hibernate.query.Query<R> setFetchSize(int fetchSize);
Query<R> setFetchSize(int fetchSize);
/**
* Should entities and proxies loaded by this Query be put in read-only mode? If the
@ -279,7 +280,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
* are to be put in read-only mode; {@code false} indicates that entities and proxies
* loaded by the query will be put in modifiable mode
*/
org.hibernate.query.Query<R> setReadOnly(boolean readOnly);
Query<R> setReadOnly(boolean readOnly);
/**
* Return the Hibernate types of the query results.
@ -314,7 +315,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @see #getLockOptions()
*/
org.hibernate.query.Query<R> setLockOptions(LockOptions lockOptions);
Query<R> setLockOptions(LockOptions lockOptions);
/**
* Set the LockMode to use for specific alias (as defined in the query's <tt>FROM</tt> clause).
@ -333,7 +334,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @see #getLockOptions()
*/
org.hibernate.query.Query<R> setLockMode(String alias, LockMode lockMode);
Query<R> setLockMode(String alias, LockMode lockMode);
/**
* Obtain the comment currently associated with this query. Provided SQL commenting is enabled
@ -354,7 +355,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @see #getComment()
*/
org.hibernate.query.Query<R> setComment(String comment);
Query<R> setComment(String comment);
/**
* Add a DB query hint to the SQL. These differ from JPA's {@link javax.persistence.QueryHint}, which is specific
@ -364,7 +365,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @param hint The database specific query hint to add.
*/
org.hibernate.query.Query<R> addQueryHint(String hint);
Query<R> addQueryHint(String hint);
/**
* Return the query results as an <tt>Iterator</tt>. If the query
@ -458,9 +459,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
<T> org.hibernate.query.Query<R> setParameter(QueryParameter<T> parameter, T val);
<T> Query<R> setParameter(QueryParameter<T> parameter, T val);
<T> org.hibernate.query.Query<R> setParameter(Parameter<T> param, T value);
<T> Query<R> setParameter(Parameter<T> param, T value);
/**
* Bind a named query parameter using its inferred Type. If the parameter is
@ -474,7 +475,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
* @return {@code this}, for method chaining
*/
@SuppressWarnings("unchecked")
org.hibernate.query.Query<R> setParameter(String name, Object val);
Query<R> setParameter(String name, Object val);
/**
* Bind a positional query parameter using its inferred Type. If the parameter is
@ -489,7 +490,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
* @return {@code this}, for method chaining
*/
@SuppressWarnings("unchecked")
org.hibernate.query.Query<R> setParameter(int position, Object val);
Query<R> setParameter(int position, Object val);
/**
* Bind a query parameter using the supplied Type
@ -500,7 +501,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
<P> org.hibernate.query.Query<R> setParameter(QueryParameter<P> parameter, P val, Type type);
<P> Query<R> setParameter(QueryParameter<P> parameter, P val, Type type);
/**
* Bind a named query parameter using the supplied Type
@ -511,7 +512,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
org.hibernate.query.Query<R> setParameter(String name, Object val, Type type);
Query<R> setParameter(String name, Object val, Type type);
/**
* Bind a value to a JDBC-style query parameter.
@ -523,7 +524,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
org.hibernate.query.Query<R> setParameter(int position, Object val, Type type);
Query<R> setParameter(int position, Object val, Type type);
/**
* Bind a query parameter as some form of date/time using the indicated
@ -535,7 +536,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
<P> org.hibernate.query.Query<R> setParameter(QueryParameter<P> parameter, P val, TemporalType temporalType);
<P> Query<R> setParameter(QueryParameter<P> parameter, P val, TemporalType temporalType);
/**
* Bind a named query parameter as some form of date/time using
@ -547,7 +548,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
<P> org.hibernate.query.Query<R> setParameter(String name, P val, TemporalType temporalType);
<P> Query<R> setParameter(String name, P val, TemporalType temporalType);
/**
* Bind a positional query parameter as some form of date/time using
@ -560,7 +561,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
<P> org.hibernate.query.Query<R> setParameter(int position, P val, TemporalType temporalType);
<P> Query<R> setParameter(int position, P val, TemporalType temporalType);
@ -586,7 +587,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
<P> org.hibernate.query.Query<R> setParameterList(QueryParameter<P> parameter, Collection<P> values);
<P> Query<R> setParameterList(QueryParameter<P> parameter, Collection<P> values);
/**
* Bind multiple values to a named query parameter. The Hibernate type of the parameter is
@ -599,7 +600,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
org.hibernate.query.Query<R> setParameterList(String name, Collection values);
Query<R> setParameterList(String name, Collection values);
/**
* Bind multiple values to a named query parameter. This is useful for binding
@ -611,7 +612,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
org.hibernate.query.Query<R> setParameterList(String name, Collection values, Type type);
Query<R> setParameterList(String name, Collection values, Type type);
/**
* Bind multiple values to a named query parameter. This is useful for binding
@ -623,7 +624,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
org.hibernate.query.Query<R> setParameterList(String name, Object[] values, Type type);
Query<R> setParameterList(String name, Object[] values, Type type);
/**
* Bind multiple values to a named query parameter. The Hibernate type of the parameter is
@ -636,7 +637,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
org.hibernate.query.Query<R> setParameterList(String name, Object[] values);
Query<R> setParameterList(String name, Object[] values);
/**
* Bind the property values of the given bean to named parameters of the query,
@ -647,7 +648,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
org.hibernate.query.Query<R> setProperties(Object bean);
Query<R> setProperties(Object bean);
/**
* Bind the values of the given Map for each named parameters of the query,
@ -658,44 +659,44 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*
* @return {@code this}, for method chaining
*/
org.hibernate.query.Query<R> setProperties(Map bean);
Query<R> setProperties(Map bean);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// covariant overrides
@Override
org.hibernate.query.Query<R> setMaxResults(int maxResult);
Query<R> setMaxResults(int maxResult);
@Override
org.hibernate.query.Query<R> setFirstResult(int startPosition);
Query<R> setFirstResult(int startPosition);
@Override
org.hibernate.query.Query<R> setHint(String hintName, Object value);
Query<R> setHint(String hintName, Object value);
@Override
org.hibernate.query.Query<R> setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType);
Query<R> setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType);
@Override
org.hibernate.query.Query<R> setParameter(Parameter<Date> param, Date value, TemporalType temporalType);
Query<R> setParameter(Parameter<Date> param, Date value, TemporalType temporalType);
@Override
org.hibernate.query.Query<R> setParameter(String name, Calendar value, TemporalType temporalType);
Query<R> setParameter(String name, Calendar value, TemporalType temporalType);
@Override
org.hibernate.query.Query<R> setParameter(String name, Date value, TemporalType temporalType);
Query<R> setParameter(String name, Date value, TemporalType temporalType);
@Override
org.hibernate.query.Query<R> setParameter(int position, Calendar value, TemporalType temporalType);
Query<R> setParameter(int position, Calendar value, TemporalType temporalType);
@Override
org.hibernate.query.Query<R> setParameter(int position, Date value, TemporalType temporalType);
Query<R> setParameter(int position, Date value, TemporalType temporalType);
@Override
org.hibernate.query.Query<R> setFlushMode(FlushModeType flushMode);
Query<R> setFlushMode(FlushModeType flushMode);
@Override
org.hibernate.query.Query<R> setLockMode(LockModeType lockMode);
Query<R> setLockMode(LockModeType lockMode);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -714,9 +715,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setString(int position, String val) {
default Query<R> setString(int position, String val) {
setParameter( position, val, StringType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -732,9 +733,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setCharacter(int position, char val) {
default Query<R> setCharacter(int position, char val) {
setParameter( position, val, CharacterType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -750,9 +751,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setBoolean(int position, boolean val) {
default Query<R> setBoolean(int position, boolean val) {
setParameter( position, val, determineProperBooleanType( position, val, BooleanType.INSTANCE ) );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -768,9 +769,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setByte(int position, byte val) {
default Query<R> setByte(int position, byte val) {
setParameter( position, val, ByteType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -786,9 +787,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setShort(int position, short val) {
default Query<R> setShort(int position, short val) {
setParameter( position, val, ShortType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -804,9 +805,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setInteger(int position, int val) {
default Query<R> setInteger(int position, int val) {
setParameter( position, val, IntegerType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -822,9 +823,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setLong(int position, long val) {
default Query<R> setLong(int position, long val) {
setParameter( position, val, LongType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -840,9 +841,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setFloat(int position, float val) {
default Query<R> setFloat(int position, float val) {
setParameter( position, val, FloatType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -858,9 +859,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setDouble(int position, double val) {
default Query<R> setDouble(int position, double val) {
setParameter( position, val, DoubleType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -876,9 +877,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setBinary(int position, byte[] val) {
default Query<R> setBinary(int position, byte[] val) {
setParameter( position, val, BinaryType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -894,9 +895,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setText(int position, String val) {
default Query<R> setText(int position, String val) {
setParameter( position, val, TextType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -912,9 +913,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setSerializable(int position, Serializable val) {
default Query<R> setSerializable(int position, Serializable val) {
setParameter( position, val );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -930,9 +931,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setLocale(int position, Locale val) {
default Query<R> setLocale(int position, Locale val) {
setParameter( position, val, LocaleType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -948,9 +949,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setBigDecimal(int position, BigDecimal val) {
default Query<R> setBigDecimal(int position, BigDecimal val) {
setParameter( position, val, BigDecimalType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -966,9 +967,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setBigInteger(int position, BigInteger val) {
default Query<R> setBigInteger(int position, BigInteger val) {
setParameter( position, val, BigIntegerType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -984,9 +985,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setDate(int position, Date val) {
default Query<R> setDate(int position, Date val) {
setParameter( position, val, DateType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1002,9 +1003,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setTime(int position, Date val) {
default Query<R> setTime(int position, Date val) {
setParameter( position, val, TimeType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1020,9 +1021,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setTimestamp(int position, Date val) {
default Query<R> setTimestamp(int position, Date val) {
setParameter( position, val, TimestampType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1038,9 +1039,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setCalendar(int position, Calendar val) {
default Query<R> setCalendar(int position, Calendar val) {
setParameter( position, val, TimestampType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1056,9 +1057,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setCalendarDate(int position, Calendar val) {
default Query<R> setCalendarDate(int position, Calendar val) {
setParameter( position, val, DateType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1074,9 +1075,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setString(String name, String val) {
default Query<R> setString(String name, String val) {
setParameter( name, val, StringType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1092,9 +1093,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setCharacter(String name, char val) {
default Query<R> setCharacter(String name, char val) {
setParameter( name, val, CharacterType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1110,9 +1111,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setBoolean(String name, boolean val) {
default Query<R> setBoolean(String name, boolean val) {
setParameter( name, val, determineProperBooleanType( name, val, BooleanType.INSTANCE ) );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1128,9 +1129,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setByte(String name, byte val) {
default Query<R> setByte(String name, byte val) {
setParameter( name, val, ByteType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1146,9 +1147,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setShort(String name, short val) {
default Query<R> setShort(String name, short val) {
setParameter( name, val, ShortType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1164,9 +1165,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setInteger(String name, int val) {
default Query<R> setInteger(String name, int val) {
setParameter( name, val, IntegerType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1182,9 +1183,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setLong(String name, long val) {
default Query<R> setLong(String name, long val) {
setParameter( name, val, LongType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1200,9 +1201,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setFloat(String name, float val) {
default Query<R> setFloat(String name, float val) {
setParameter( name, val, FloatType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1218,9 +1219,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setDouble(String name, double val) {
default Query<R> setDouble(String name, double val) {
setParameter( name, val, DoubleType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1236,9 +1237,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setBinary(String name, byte[] val) {
default Query<R> setBinary(String name, byte[] val) {
setParameter( name, val, BinaryType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1254,9 +1255,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setText(String name, String val) {
default Query<R> setText(String name, String val) {
setParameter( name, val, TextType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1272,9 +1273,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setSerializable(String name, Serializable val) {
default Query<R> setSerializable(String name, Serializable val) {
setParameter( name, val );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1289,9 +1290,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setLocale(String name, Locale val) {
default Query<R> setLocale(String name, Locale val) {
setParameter( name, val, TextType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1306,9 +1307,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setBigDecimal(String name, BigDecimal val) {
default Query<R> setBigDecimal(String name, BigDecimal val) {
setParameter( name, val, BigDecimalType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1323,9 +1324,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setBigInteger(String name, BigInteger val) {
default Query<R> setBigInteger(String name, BigInteger val) {
setParameter( name, val, BigIntegerType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1341,9 +1342,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setDate(String name, Date val) {
default Query<R> setDate(String name, Date val) {
setParameter( name, val, DateType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1359,9 +1360,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setTime(String name, Date val) {
default Query<R> setTime(String name, Date val) {
setParameter( name, val, TimeType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1377,9 +1378,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setTimestamp(String name, Date value) {
default Query<R> setTimestamp(String name, Date value) {
setParameter( name, value, TimestampType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1395,9 +1396,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setCalendar(String name, Calendar value) {
default Query<R> setCalendar(String name, Calendar value) {
setParameter( name, value, TimestampType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1413,9 +1414,9 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setCalendarDate(String name, Calendar value) {
default Query<R> setCalendarDate(String name, Calendar value) {
setParameter( name, value, DateType.INSTANCE );
return (org.hibernate.query.Query) this;
return this;
}
/**
@ -1433,7 +1434,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
org.hibernate.query.Query<R> setEntity(int position, Object val);
Query<R> setEntity(int position, Object val);
/**
* Bind an instance of a mapped persistent class to a named query parameter. Use
@ -1449,7 +1450,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
org.hibernate.query.Query<R> setEntity(String name, Object val);
Query<R> setEntity(String name, Object val);
/**
* @deprecated added only to allow default method definition for deprecated methods here.
@ -1479,7 +1480,7 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
* @todo develop a new approach to result transformers
*/
@Deprecated
org.hibernate.query.Query<R> setResultTransformer(ResultTransformer transformer);
Query<R> setResultTransformer(ResultTransformer transformer);
/**
* @deprecated (since 5.2) use {@link javax.persistence.Tuple} if you need access to "result variables".
@ -1503,12 +1504,12 @@ public interface Query<R> extends org.hibernate.BasicQueryContract, TypedQuery<R
*/
@Deprecated
@SuppressWarnings("unchecked")
default org.hibernate.query.Query<R> setParameters(Object[] values, Type[] types) {
default Query<R> setParameters(Object[] values, Type[] types) {
assert values.length == types.length;
for ( int i = 0; i < values.length; i++ ) {
setParameter( i, values[i], types[i] );
}
return (org.hibernate.query.Query) this;
return this;
}
}

View File

@ -0,0 +1,14 @@
/*
* 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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ejb;
/**
* @Deprecated use org.hibernate.jpa.AvailableSettings
*/
@Deprecated
public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings {
}

View File

@ -0,0 +1,14 @@
/*
* 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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ejb;
/**
* @deprecated Use {@link org.hibernate.jpa.HibernateEntityManager} instead
*/
@Deprecated
public interface HibernateEntityManager extends org.hibernate.jpa.HibernateEntityManager {
}

View File

@ -0,0 +1,14 @@
/*
* 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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ejb;
/**
* @deprecated Use {@link org.hibernate.jpa.HibernateEntityManagerFactory} instead
*/
@Deprecated
public interface HibernateEntityManagerFactory extends org.hibernate.jpa.HibernateEntityManagerFactory {
}

View File

@ -0,0 +1,14 @@
/*
* 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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ejb;
/**
* @deprecated Use {@link org.hibernate.jpa.HibernateQuery} instead
*/
@Deprecated
public interface HibernateQuery extends org.hibernate.jpa.HibernateQuery {
}

View File

@ -26,6 +26,7 @@ import org.hibernate.Incubating;
import org.hibernate.LockMode;
import org.hibernate.LockOptions;
import org.hibernate.engine.spi.RowSelection;
import org.hibernate.type.Type;
/**
* Represents an HQL/JPQL query or a compiled Criteria query. Also acts as the Hibernate
@ -123,6 +124,9 @@ public interface Query<R> extends TypedQuery<R>, org.hibernate.Query<R>, CommonQ
@Override
Query<R> setParameter(String name, Object value);
@Override
Query<R> setParameter(String name, Object val, Type type);
@Override
Query<R> setParameter(String name, Calendar value, TemporalType temporalType);