From 59a3b4587ed44eb5610b319d28cb4091a801740c Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Tue, 21 Jun 2016 19:09:10 +0100 Subject: [PATCH] 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 --- .../src/main/java/org/hibernate/Query.java | 255 +++++++++--------- .../org/hibernate/ejb/AvailableSettings.java | 14 + .../hibernate/ejb/HibernateEntityManager.java | 14 + .../ejb/HibernateEntityManagerFactory.java | 14 + .../org/hibernate/ejb/HibernateQuery.java | 14 + .../main/java/org/hibernate/query/Query.java | 4 + 6 files changed, 188 insertions(+), 127 deletions(-) create mode 100644 hibernate-core/src/main/java/org/hibernate/ejb/AvailableSettings.java create mode 100644 hibernate-core/src/main/java/org/hibernate/ejb/HibernateEntityManager.java create mode 100644 hibernate-core/src/main/java/org/hibernate/ejb/HibernateEntityManagerFactory.java create mode 100644 hibernate-core/src/main/java/org/hibernate/ejb/HibernateQuery.java diff --git a/hibernate-core/src/main/java/org/hibernate/Query.java b/hibernate-core/src/main/java/org/hibernate/Query.java index fe71fe336b..a69667e506 100644 --- a/hibernate-core/src/main/java/org/hibernate/Query.java +++ b/hibernate-core/src/main/java/org/hibernate/Query.java @@ -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 extends org.hibernate.BasicQueryContract, TypedQuery { +public interface Query extends TypedQuery, CommonQueryContract { /** * Get the query string. @@ -83,9 +84,9 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setHibernateFlushMode(FlushMode flushMode) { + default Query setHibernateFlushMode(FlushMode flushMode) { setFlushMode( flushMode ); - return (org.hibernate.query.Query) this; + return this; } /** @@ -100,7 +101,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setFlushMode(FlushMode flushMode); + Query setFlushMode(FlushMode flushMode); /** * For users of the Hibernate native APIs, we've had to rename this method @@ -135,7 +136,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setCacheMode(CacheMode cacheMode); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setCacheable(boolean cacheable); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setCacheRegion(String cacheRegion); + Query setCacheRegion(String cacheRegion); /** * Obtain the query timeout in seconds. This value is eventually passed along to the JDBC query via @@ -207,7 +208,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setTimeout(int timeout); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setFetchSize(int fetchSize); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setReadOnly(boolean readOnly); + Query setReadOnly(boolean readOnly); /** * Return the Hibernate types of the query results. @@ -314,7 +315,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setLockOptions(LockOptions lockOptions); + Query setLockOptions(LockOptions lockOptions); /** * Set the LockMode to use for specific alias (as defined in the query's FROM clause). @@ -333,7 +334,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setLockMode(String alias, LockMode lockMode); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setComment(String comment); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery addQueryHint(String hint); + Query addQueryHint(String hint); /** * Return the query results as an Iterator. If the query @@ -458,9 +459,9 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery org.hibernate.query.Query setParameter(QueryParameter parameter, T val); + Query setParameter(QueryParameter parameter, T val); - org.hibernate.query.Query setParameter(Parameter param, T value); + Query setParameter(Parameter param, T value); /** * Bind a named query parameter using its inferred Type. If the parameter is @@ -474,7 +475,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setParameter(String name, Object val); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setParameter(int position, Object val); + Query setParameter(int position, Object val); /** * Bind a query parameter using the supplied Type @@ -500,7 +501,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery org.hibernate.query.Query setParameter(QueryParameter

parameter, P val, Type type); +

Query setParameter(QueryParameter

parameter, P val, Type type); /** * Bind a named query parameter using the supplied Type @@ -511,7 +512,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setParameter(String name, Object val, Type type); + Query setParameter(String name, Object val, Type type); /** * Bind a value to a JDBC-style query parameter. @@ -523,7 +524,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setParameter(int position, Object val, Type type); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery org.hibernate.query.Query setParameter(QueryParameter

parameter, P val, TemporalType temporalType); +

Query setParameter(QueryParameter

parameter, P val, TemporalType temporalType); /** * Bind a named query parameter as some form of date/time using @@ -547,7 +548,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery org.hibernate.query.Query setParameter(String name, P val, TemporalType temporalType); +

Query 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 extends org.hibernate.BasicQueryContract, TypedQuery org.hibernate.query.Query setParameter(int position, P val, TemporalType temporalType); +

Query setParameter(int position, P val, TemporalType temporalType); @@ -586,7 +587,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery org.hibernate.query.Query setParameterList(QueryParameter

parameter, Collection

values); +

Query setParameterList(QueryParameter

parameter, Collection

values); /** * Bind multiple values to a named query parameter. The Hibernate type of the parameter is @@ -599,7 +600,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setParameterList(String name, Collection values); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setParameterList(String name, Collection values, Type type); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setParameterList(String name, Object[] values, Type type); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setParameterList(String name, Object[] values); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setProperties(Object bean); + Query setProperties(Object bean); /** * Bind the values of the given Map for each named parameters of the query, @@ -658,44 +659,44 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setProperties(Map bean); + Query setProperties(Map bean); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // covariant overrides @Override - org.hibernate.query.Query setMaxResults(int maxResult); + Query setMaxResults(int maxResult); @Override - org.hibernate.query.Query setFirstResult(int startPosition); + Query setFirstResult(int startPosition); @Override - org.hibernate.query.Query setHint(String hintName, Object value); + Query setHint(String hintName, Object value); @Override - org.hibernate.query.Query setParameter(Parameter param, Calendar value, TemporalType temporalType); + Query setParameter(Parameter param, Calendar value, TemporalType temporalType); @Override - org.hibernate.query.Query setParameter(Parameter param, Date value, TemporalType temporalType); + Query setParameter(Parameter param, Date value, TemporalType temporalType); @Override - org.hibernate.query.Query setParameter(String name, Calendar value, TemporalType temporalType); + Query setParameter(String name, Calendar value, TemporalType temporalType); @Override - org.hibernate.query.Query setParameter(String name, Date value, TemporalType temporalType); + Query setParameter(String name, Date value, TemporalType temporalType); @Override - org.hibernate.query.Query setParameter(int position, Calendar value, TemporalType temporalType); + Query setParameter(int position, Calendar value, TemporalType temporalType); @Override - org.hibernate.query.Query setParameter(int position, Date value, TemporalType temporalType); + Query setParameter(int position, Date value, TemporalType temporalType); @Override - org.hibernate.query.Query setFlushMode(FlushModeType flushMode); + Query setFlushMode(FlushModeType flushMode); @Override - org.hibernate.query.Query setLockMode(LockModeType lockMode); + Query setLockMode(LockModeType lockMode); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -714,9 +715,9 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setString(int position, String val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setCharacter(int position, char val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setBoolean(int position, boolean val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setByte(int position, byte val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setShort(int position, short val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setInteger(int position, int val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setLong(int position, long val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setFloat(int position, float val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setDouble(int position, double val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setBinary(int position, byte[] val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setText(int position, String val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setSerializable(int position, Serializable val) { + default Query setSerializable(int position, Serializable val) { setParameter( position, val ); - return (org.hibernate.query.Query) this; + return this; } /** @@ -930,9 +931,9 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setLocale(int position, Locale val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setBigDecimal(int position, BigDecimal val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setBigInteger(int position, BigInteger val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setDate(int position, Date val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setTime(int position, Date val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setTimestamp(int position, Date val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setCalendar(int position, Calendar val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setCalendarDate(int position, Calendar val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setString(String name, String val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setCharacter(String name, char val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setBoolean(String name, boolean val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setByte(String name, byte val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setShort(String name, short val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setInteger(String name, int val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setLong(String name, long val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setFloat(String name, float val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setDouble(String name, double val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setBinary(String name, byte[] val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setText(String name, String val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setSerializable(String name, Serializable val) { + default Query setSerializable(String name, Serializable val) { setParameter( name, val ); - return (org.hibernate.query.Query) this; + return this; } /** @@ -1289,9 +1290,9 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setLocale(String name, Locale val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setBigDecimal(String name, BigDecimal val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setBigInteger(String name, BigInteger val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setDate(String name, Date val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setTime(String name, Date val) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setTimestamp(String name, Date value) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setCalendar(String name, Calendar value) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setCalendarDate(String name, Calendar value) { + default Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setEntity(int position, Object val); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setEntity(String name, Object val); + Query setEntity(String name, Object val); /** * @deprecated added only to allow default method definition for deprecated methods here. @@ -1479,7 +1480,7 @@ public interface Query extends org.hibernate.BasicQueryContract, TypedQuery setResultTransformer(ResultTransformer transformer); + Query 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 extends org.hibernate.BasicQueryContract, TypedQuery setParameters(Object[] values, Type[] types) { + default Query 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; } } diff --git a/hibernate-core/src/main/java/org/hibernate/ejb/AvailableSettings.java b/hibernate-core/src/main/java/org/hibernate/ejb/AvailableSettings.java new file mode 100644 index 0000000000..5d30d92db9 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/ejb/AvailableSettings.java @@ -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 . + */ +package org.hibernate.ejb; + +/** + * @Deprecated use org.hibernate.jpa.AvailableSettings + */ +@Deprecated +public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { +} diff --git a/hibernate-core/src/main/java/org/hibernate/ejb/HibernateEntityManager.java b/hibernate-core/src/main/java/org/hibernate/ejb/HibernateEntityManager.java new file mode 100644 index 0000000000..8b8cfdc664 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/ejb/HibernateEntityManager.java @@ -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 . + */ +package org.hibernate.ejb; + +/** + * @deprecated Use {@link org.hibernate.jpa.HibernateEntityManager} instead + */ +@Deprecated +public interface HibernateEntityManager extends org.hibernate.jpa.HibernateEntityManager { +} \ No newline at end of file diff --git a/hibernate-core/src/main/java/org/hibernate/ejb/HibernateEntityManagerFactory.java b/hibernate-core/src/main/java/org/hibernate/ejb/HibernateEntityManagerFactory.java new file mode 100644 index 0000000000..2887532570 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/ejb/HibernateEntityManagerFactory.java @@ -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 . + */ +package org.hibernate.ejb; + +/** + * @deprecated Use {@link org.hibernate.jpa.HibernateEntityManagerFactory} instead + */ +@Deprecated +public interface HibernateEntityManagerFactory extends org.hibernate.jpa.HibernateEntityManagerFactory { +} \ No newline at end of file diff --git a/hibernate-core/src/main/java/org/hibernate/ejb/HibernateQuery.java b/hibernate-core/src/main/java/org/hibernate/ejb/HibernateQuery.java new file mode 100644 index 0000000000..f7711bb078 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/ejb/HibernateQuery.java @@ -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 . + */ +package org.hibernate.ejb; + +/** + * @deprecated Use {@link org.hibernate.jpa.HibernateQuery} instead + */ +@Deprecated +public interface HibernateQuery extends org.hibernate.jpa.HibernateQuery { +} \ No newline at end of file diff --git a/hibernate-core/src/main/java/org/hibernate/query/Query.java b/hibernate-core/src/main/java/org/hibernate/query/Query.java index f702908f6b..7a52aedc18 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/Query.java +++ b/hibernate-core/src/main/java/org/hibernate/query/Query.java @@ -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 extends TypedQuery, org.hibernate.Query, CommonQ @Override Query setParameter(String name, Object value); + @Override + Query setParameter(String name, Object val, Type type); + @Override Query setParameter(String name, Calendar value, TemporalType temporalType);