Skip to content

Commit 45f82cb

Browse files
committed
HHH-10664 - Prep 6.0 feature branch - merge hibernate-entitymanager into hibernate-core (first sucessful full compile of consolidated hibernate-core)
1 parent 1acd1e5 commit 45f82cb

File tree

802 files changed

+17759
-13917
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

802 files changed

+17759
-13917
lines changed

documentation/src/main/asciidoc/quickstart/guides/tutorial_jpa.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The previous tutorials used the Hibernate native APIs. This tutorial uses the J
6161
[source, JAVA]
6262
----
6363
protected void setUp() throws Exception {
64-
entityManagerFactory = Persistence.createEntityManagerFactory( "org.hibernate.tutorial.jpa" );
64+
sessionFactory = Persistence.createEntityManagerFactory( "org.hibernate.tutorial.jpa" );
6565
}
6666
----
6767
====
@@ -74,7 +74,7 @@ Notice again that the persistence unit name is `org.hibernate.tutorial.jpa`, whi
7474
====
7575
[source, JAVA]
7676
----
77-
EntityManager entityManager = entityManagerFactory.createEntityManager();
77+
EntityManager entityManager = sessionFactory.createEntityManager();
7878
entityManager.getTransaction().begin();
7979
entityManager.persist( new Event( "Our very first event!", new Date() ) );
8080
entityManager.persist( new Event( "A follow up event", new Date() ) );
@@ -92,7 +92,7 @@ is used instead of the `org.hibernate.Session` interface. JPA calls this operat
9292
====
9393
[source, JAVA]
9494
----
95-
entityManager = entityManagerFactory.createEntityManager();
95+
entityManager = sessionFactory.createEntityManager();
9696
entityManager.getTransaction().begin();
9797
List<Event> result = entityManager.createQuery( "from Event", Event.class ).getResultList();
9898
for ( Event event : result ) {

documentation/src/main/docbook/manual-old/en-US/content/bootstrap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@
916916
<listitem>
917917
<para>
918918
<literal>hibernate.query.plan_parameter_metadata_max_size</literal> - Controls the maximum number of
919-
<interfacename>org.hibernate.engine.query.spi.ParameterMetadata</interfacename> instances Hibernate
919+
<interfacename>org.hibernate.query.internal.ParameterMetadata</interfacename> instances Hibernate
920920
will maintain in its QueryPlanCache. The default is 128.
921921
</para>
922922
</listitem>

hibernate-c3p0/src/main/java/org/hibernate/c3p0/internal/C3P0MessageLogger.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import java.sql.SQLException;
1010

11-
import org.hibernate.internal.CoreMessageLogger;
1211
import org.hibernate.internal.log.ConnectionPoolingLogger;
1312

1413
import org.jboss.logging.annotations.Cause;
@@ -23,7 +22,7 @@
2322
* The jboss-logging {@link MessageLogger} for the hibernate-c3p0 module. It reserves message ids ranging from
2423
* 10001 to 15000 inclusively.
2524
* <p/>
26-
* New messages must be added after the last message defined to ensure message codes are unique.
25+
* New messages must be added afterQuery the last message defined to ensure message codes are unique.
2726
*/
2827
@MessageLogger(projectCode = "HHH")
2928
public interface C3P0MessageLogger extends ConnectionPoolingLogger {

hibernate-core/hibernate-core.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ dependencies {
3030
provided( libraries.jacc )
3131
provided( libraries.validation )
3232
provided( libraries.ant )
33+
provided( "javax.enterprise:cdi-api:1.1-PFD" )
3334

3435
testCompile( project(':hibernate-testing') )
3536
testCompile( libraries.validation )

hibernate-core/src/main/java/org/hibernate/BasicQueryContract.java

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,38 @@
1212
* Defines the aspects of query definition that apply to all forms of querying.
1313
*
1414
* @author Steve Ebersole
15+
*
16+
* @deprecated (since 5.2) use {@link org.hibernate.query.BasicQueryContract} instead.
1517
*/
18+
@Deprecated
1619
public interface BasicQueryContract {
20+
/**
21+
* (Re)set the current FlushMode in effect for this query.
22+
*
23+
* @param flushMode The new FlushMode to use.
24+
*
25+
* @return {@code this}, for method chaining
26+
*
27+
* @see #getHibernateFlushMode()
28+
*
29+
* @deprecated (since 5.2) use {@link #setHibernateFlushMode} instead
30+
*/
31+
@Deprecated
32+
default org.hibernate.query.BasicQueryContract setFlushMode(FlushMode flushMode) {
33+
setHibernateFlushMode( flushMode );
34+
return (org.hibernate.query.BasicQueryContract) this;
35+
}
36+
1737
/**
1838
* Obtain the FlushMode in effect for this query. By default, the query inherits the FlushMode of the Session
19-
* from which is originates.
39+
* from which it originates.
2040
*
2141
* @return The query FlushMode.
2242
*
2343
* @see Session#getFlushMode()
2444
* @see FlushMode
2545
*/
26-
public FlushMode getFlushMode();
46+
FlushMode getHibernateFlushMode();
2747

2848
/**
2949
* (Re)set the current FlushMode in effect for this query.
@@ -32,9 +52,9 @@ public interface BasicQueryContract {
3252
*
3353
* @return {@code this}, for method chaining
3454
*
35-
* @see #getFlushMode()
55+
* @see #getHibernateFlushMode()
3656
*/
37-
public BasicQueryContract setFlushMode(FlushMode flushMode);
57+
org.hibernate.query.BasicQueryContract setHibernateFlushMode(FlushMode flushMode);
3858

3959
/**
4060
* Obtain the CacheMode in effect for this query. By default, the query inherits the CacheMode of the Session
@@ -48,7 +68,7 @@ public interface BasicQueryContract {
4868
* @see Session#getCacheMode()
4969
* @see CacheMode
5070
*/
51-
public CacheMode getCacheMode();
71+
CacheMode getCacheMode();
5272

5373
/**
5474
* (Re)set the current CacheMode in effect for this query.
@@ -59,7 +79,7 @@ public interface BasicQueryContract {
5979
*
6080
* @see #getCacheMode()
6181
*/
62-
public BasicQueryContract setCacheMode(CacheMode cacheMode);
82+
org.hibernate.query.BasicQueryContract setCacheMode(CacheMode cacheMode);
6383

6484
/**
6585
* Are the results of this query eligible for second level query caching? This is different that second level
@@ -73,7 +93,7 @@ public interface BasicQueryContract {
7393
*
7494
* @see org.hibernate.cfg.AvailableSettings#USE_QUERY_CACHE
7595
*/
76-
public boolean isCacheable();
96+
boolean isCacheable();
7797

7898
/**
7999
* Enable/disable second level query (result) caching for this query.
@@ -84,7 +104,7 @@ public interface BasicQueryContract {
84104
*
85105
* @see #isCacheable
86106
*/
87-
public BasicQueryContract setCacheable(boolean cacheable);
107+
org.hibernate.query.BasicQueryContract setCacheable(boolean cacheable);
88108

89109
/**
90110
* Obtain the name of the second level query cache region in which query results will be stored (if they are
@@ -94,7 +114,7 @@ public interface BasicQueryContract {
94114
* @return The specified cache region name into which query results should be placed; {@code null} indicates
95115
* the default region.
96116
*/
97-
public String getCacheRegion();
117+
String getCacheRegion();
98118

99119
/**
100120
* Set the name of the cache region where query results should be cached (if cached at all).
@@ -106,7 +126,7 @@ public interface BasicQueryContract {
106126
*
107127
* @see #getCacheRegion()
108128
*/
109-
public BasicQueryContract setCacheRegion(String cacheRegion);
129+
org.hibernate.query.BasicQueryContract setCacheRegion(String cacheRegion);
110130

111131
/**
112132
* Obtain the query timeout <b>in seconds</b>. This value is eventually passed along to the JDBC query via
@@ -117,7 +137,7 @@ public interface BasicQueryContract {
117137
* @see java.sql.Statement#getQueryTimeout()
118138
* @see java.sql.Statement#setQueryTimeout(int)
119139
*/
120-
public Integer getTimeout();
140+
Integer getTimeout();
121141

122142
/**
123143
* Set the query timeout <b>in seconds</b>.
@@ -131,7 +151,7 @@ public interface BasicQueryContract {
131151
*
132152
* @see #getTimeout()
133153
*/
134-
public BasicQueryContract setTimeout(int timeout);
154+
org.hibernate.query.BasicQueryContract setTimeout(int timeout);
135155

136156
/**
137157
* Obtain the JDBC fetch size hint in effect for this query. This value is eventually passed along to the JDBC
@@ -146,7 +166,7 @@ public interface BasicQueryContract {
146166
* @see java.sql.Statement#getFetchSize()
147167
* @see java.sql.Statement#setFetchSize(int)
148168
*/
149-
public Integer getFetchSize();
169+
Integer getFetchSize();
150170

151171
/**
152172
* Sets a JDBC fetch size hint for the query.
@@ -157,22 +177,23 @@ public interface BasicQueryContract {
157177
*
158178
* @see #getFetchSize()
159179
*/
160-
public BasicQueryContract setFetchSize(int fetchSize);
180+
org.hibernate.query.BasicQueryContract setFetchSize(int fetchSize);
161181

162182
/**
163183
* Should entities and proxies loaded by this Query be put in read-only mode? If the
164184
* read-only/modifiable setting was not initialized, then the default
165185
* read-only/modifiable setting for the persistence context is returned instead.
166-
* @see Query#setReadOnly(boolean)
186+
*
187+
* @see #setReadOnly(boolean)
167188
* @see org.hibernate.engine.spi.PersistenceContext#isDefaultReadOnly()
168189
*
169190
* The read-only/modifiable setting has no impact on entities/proxies returned by the
170-
* query that existed in the session before the query was executed.
191+
* query that existed in the session beforeQuery the query was executed.
171192
*
172-
* @return true, entities and proxies loaded by the query will be put in read-only mode
173-
* false, entities and proxies loaded by the query will be put in modifiable mode
193+
* @return {@code true} if the entities and proxies loaded by the query will be put
194+
* in read-only mode; {@code false} otherwise (they will be modifiable)
174195
*/
175-
public boolean isReadOnly();
196+
boolean isReadOnly();
176197

177198
/**
178199
* Set the read-only/modifiable mode for entities and proxies
@@ -183,7 +204,7 @@ public interface BasicQueryContract {
183204
* To set the default read-only/modifiable setting used for
184205
* entities and proxies that are loaded into the session:
185206
* @see org.hibernate.engine.spi.PersistenceContext#setDefaultReadOnly(boolean)
186-
* @see org.hibernate.Session#setDefaultReadOnly(boolean)
207+
* @see Session#setDefaultReadOnly(boolean)
187208
*
188209
* Read-only entities are not dirty-checked and snapshots of persistent
189210
* state are not maintained. Read-only entities can be modified, but
@@ -194,19 +215,23 @@ public interface BasicQueryContract {
194215
* proxy has, regardless of the session's current setting.
195216
*
196217
* The read-only/modifiable setting has no impact on entities/proxies
197-
* returned by the query that existed in the session before the query was executed.
218+
* returned by the query that existed in the session beforeQuery the query was executed.
198219
*
199220
* @return {@code this}, for method chaining
200221
*
201-
* @param readOnly true, entities and proxies loaded by the query will be put in read-only mode
202-
* false, entities and proxies loaded by the query will be put in modifiable mode
222+
* @param readOnly {@code true} indicates that entities and proxies loaded by the query
223+
* are to be put in read-only mode; {@code false} indicates that entities and proxies
224+
* loaded by the query will be put in modifiable mode
203225
*/
204-
public BasicQueryContract setReadOnly(boolean readOnly);
226+
org.hibernate.query.BasicQueryContract setReadOnly(boolean readOnly);
205227

206228
/**
207229
* Return the Hibernate types of the query results.
208230
*
209231
* @return an array of types
232+
*
233+
* @deprecated (since 5.2) with no replacement; to be removed in 6.0
210234
*/
211-
public Type[] getReturnTypes();
235+
@Deprecated
236+
Type[] getReturnTypes();
212237
}

0 commit comments

Comments
 (0)