Skip to content

Commit 5080d83

Browse files
committed
[hibernate#950] Move previous methods in different interfaces
1 parent cbd5c69 commit 5080d83

13 files changed

+223
-198
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/common/spi/Implementor.java

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
package org.hibernate.reactive.common.spi;
77

8+
89
import org.hibernate.reactive.context.Context;
910
import org.hibernate.service.ServiceRegistry;
1011

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/* Hibernate, Relational Persistence for Idiomatic Java
2+
*
3+
* SPDX-License-Identifier: Apache-2.0
4+
* Copyright: Red Hat Inc. and Hibernate Authors
5+
*/
6+
package org.hibernate.reactive.common.spi;
7+
8+
import java.util.function.Function;
9+
10+
import org.hibernate.reactive.mutiny.Mutiny;
11+
12+
/**
13+
* @deprecated It will be removed
14+
*/
15+
@Deprecated
16+
public interface MutinyImplementor {
17+
18+
/**
19+
* Obtain a new {@link Mutiny.Session reactive session}, the main
20+
* interaction point between the user's program and Hibernate
21+
* Reactive.
22+
* <p>
23+
* The underlying database connection is obtained lazily when
24+
* the returned {@link Mutiny.Session} needs to access the database.
25+
* <p>
26+
* The client must explicitly close the session by calling
27+
* {@link Mutiny.Session#close()}.
28+
*
29+
* @see Mutiny.SessionFactory#withSession(Function)
30+
* @see Mutiny.SessionFactory#openSession()
31+
*/
32+
Mutiny.Session newSession();
33+
34+
/**
35+
* Obtain a new {@link Mutiny.Session reactive session} for a
36+
* specified tenant.
37+
* <p>
38+
* The underlying database connection is obtained lazily when
39+
* the returned {@link Mutiny.Session} needs to access the database.
40+
* <p>
41+
* The client must explicitly close the session by calling
42+
* {@link Mutiny.Session#close()}.
43+
*
44+
* @param tenantId the id of the tenant
45+
*
46+
* @see Mutiny.SessionFactory#withSession(String, Function)
47+
* @see Mutiny.SessionFactory#openSession(String)
48+
*/
49+
Mutiny.Session newSession(String tenantId);
50+
51+
/**
52+
* Obtain a {@link Mutiny.StatelessSession reactive stateless session}.
53+
* <p>
54+
* The underlying database connection is obtained lazily when
55+
* the returned {@link Mutiny.StatelessSession} needs to access the
56+
* database.
57+
* <p>
58+
* The client must explicitly close the session by calling
59+
* {@link Mutiny.StatelessSession#close()}.
60+
*
61+
* @see Mutiny.SessionFactory#openStatelessSession()
62+
* @see Mutiny.SessionFactory#withStatelessSession(Function)
63+
*/
64+
Mutiny.StatelessSession newStatelessSession();
65+
66+
/**
67+
* Obtain a {@link Mutiny.StatelessSession reactive stateless session}.
68+
* <p>
69+
* The underlying database connection is obtained lazily when
70+
* the returned {@link Mutiny.StatelessSession} needs to access the
71+
* database.
72+
* <p>
73+
* The client must explicitly close the session by calling
74+
* {@link Mutiny.StatelessSession#close()}.
75+
*
76+
* @param tenantId the id of the tenant
77+
*
78+
* @see Mutiny.SessionFactory#openStatelessSession(String)
79+
* @see Mutiny.SessionFactory#withSession(String, Function)
80+
*/
81+
Mutiny.StatelessSession newStatelessSession(String tenantId);
82+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/* Hibernate, Relational Persistence for Idiomatic Java
2+
*
3+
* SPDX-License-Identifier: Apache-2.0
4+
* Copyright: Red Hat Inc. and Hibernate Authors
5+
*/
6+
package org.hibernate.reactive.common.spi;
7+
8+
import org.hibernate.reactive.stage.Stage;
9+
10+
/**
11+
* @deprecated It will be removed
12+
*/
13+
@Deprecated
14+
public interface StageImplementor {
15+
/**
16+
* Obtain a new {@link Stage.Session reactive session}, the main
17+
* interaction point between the user's program and Hibernate
18+
* Reactive.
19+
* <p>
20+
* The underlying database connection is obtained lazily when
21+
* the returned {@link Stage.Session} needs to access the database.
22+
* <p>
23+
* The client must explicitly close the session by calling
24+
* {@link Stage.Session#close()}.
25+
*
26+
* @see Stage.SessionFactory#withSession(Function)
27+
* @see Stage.SessionFactory#openSession()
28+
*/
29+
Stage.Session newSession();
30+
31+
/**
32+
* Obtain a new {@link Stage.Session reactive session} for a
33+
* specified tenant.
34+
* <p>
35+
* The underlying database connection is obtained lazily when
36+
* the returned {@link Stage.Session} needs to access the database.
37+
* <p>
38+
* The client must explicitly close the session by calling
39+
* {@link Stage.Session#close()}.
40+
*
41+
* @param tenantId the id of the tenant
42+
*
43+
* @see Stage.SessionFactory#withSession(Function)
44+
* @see Stage.SessionFactory#openSession(String)
45+
* @deprecated
46+
*/
47+
Stage.Session newSession(String tenantId);
48+
49+
/**
50+
* Obtain a {@link Stage.StatelessSession reactive stateless session}.
51+
* <p>
52+
* The underlying database connection is obtained lazily when
53+
* the returned {@link Stage.StatelessSession} needs to access the
54+
* database.
55+
* <p>
56+
* The client must explicitly close the session by calling
57+
* {@link Stage.StatelessSession#close()}.
58+
*
59+
* @see Stage.SessionFactory#openStatelessSession()
60+
* @see Stage.SessionFactory#withStatelessSession(Function)
61+
* @deprecated
62+
*/
63+
Stage.StatelessSession newStatelessSession();
64+
65+
/**
66+
* Obtain a {@link Stage.StatelessSession reactive stateless session}.
67+
* <p>
68+
* The underlying database connection is obtained lazily when
69+
* the returned {@link Stage.StatelessSession} needs to access the
70+
* database.
71+
* <p>
72+
* The client must explicitly close the session by calling
73+
* {@link Stage.StatelessSession#close()}.
74+
*
75+
* @param tenantId the id of the tenant
76+
*
77+
* @see Stage.SessionFactory#openStatelessSession(String
78+
* @see Stage.SessionFactory#withStatelessSession(String, Function)
79+
*/
80+
Stage.StatelessSession newStatelessSession(String tenantId);
81+
}

hibernate-reactive-core/src/main/java/org/hibernate/reactive/mutiny/Mutiny.java

+4-76
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ interface SessionFactory extends AutoCloseable {
15271527
*
15281528
* @see #withSession(Function)
15291529
*/
1530-
Uni<Session> newSession();
1530+
Uni<Session> openSession();
15311531

15321532
/**
15331533
* Obtain a new {@link Session reactive session} {@link Uni} for a
@@ -1542,7 +1542,7 @@ interface SessionFactory extends AutoCloseable {
15421542
*
15431543
* @see #withSession(Function)
15441544
*/
1545-
Uni<Session> newSession(String tenantId);
1545+
Uni<Session> openSession(String tenantId);
15461546

15471547
/**
15481548
* Obtain a {@link StatelessSession reactive stateless session}
@@ -1555,7 +1555,7 @@ interface SessionFactory extends AutoCloseable {
15551555
*
15561556
* @see #withStatelessSession(Function)
15571557
*/
1558-
Uni<StatelessSession> newStatelessSession();
1558+
Uni<StatelessSession> openStatelessSession();
15591559

15601560
/**
15611561
* Obtain a {@link StatelessSession reactive stateless session}
@@ -1570,80 +1570,8 @@ interface SessionFactory extends AutoCloseable {
15701570
*
15711571
* @see #withStatelessSession(String, Function)
15721572
*/
1573-
Uni<StatelessSession> newStatelessSession(String tenantId);
1573+
Uni<StatelessSession> openStatelessSession(String tenantId);
15741574

1575-
/**
1576-
* Obtain a new {@link Session reactive session}, the main
1577-
* interaction point between the user's program and Hibernate
1578-
* Reactive.
1579-
* <p>
1580-
* The underlying database connection is obtained lazily when
1581-
* the returned {@link Session} needs to access the database.
1582-
* <p>
1583-
* The client must explicitly close the session by calling
1584-
* {@link Session#close()}.
1585-
*
1586-
* @see #withSession(Function)
1587-
* @see #newSession()
1588-
* @deprecated It will be removed before the final
1589-
*/
1590-
@Deprecated
1591-
Session openSession();
1592-
1593-
/**
1594-
* Obtain a new {@link Session reactive session} for a
1595-
* specified tenant.
1596-
* <p>
1597-
* The underlying database connection is obtained lazily when
1598-
* the returned {@link Session} needs to access the database.
1599-
* <p>
1600-
* The client must explicitly close the session by calling
1601-
* {@link Session#close()}.
1602-
*
1603-
* @param tenantId the id of the tenant
1604-
*
1605-
* @see #withSession(String, Function)
1606-
* @see #newSession(String)
1607-
* @deprecated It will be removed before the final
1608-
*
1609-
*/
1610-
@Deprecated
1611-
Session openSession(String tenantId);
1612-
1613-
/**
1614-
* Obtain a {@link StatelessSession reactive stateless session}.
1615-
* <p>
1616-
* The underlying database connection is obtained lazily when
1617-
* the returned {@link StatelessSession} needs to access the
1618-
* database.
1619-
* <p>
1620-
* The client must explicitly close the session by calling
1621-
* {@link StatelessSession#close()}.
1622-
*
1623-
* @deprecated It will be removed before the final
1624-
* @see #newStatelessSession()
1625-
* @see #withStatelessSession(Function)
1626-
*/
1627-
@Deprecated
1628-
StatelessSession openStatelessSession();
1629-
1630-
/**
1631-
* Obtain a {@link StatelessSession reactive stateless session}.
1632-
* <p>
1633-
* The underlying database connection is obtained lazily when
1634-
* the returned {@link StatelessSession} needs to access the
1635-
* database.
1636-
* <p>
1637-
* The client must explicitly close the session by calling
1638-
* {@link StatelessSession#close()}.
1639-
*
1640-
* @param tenantId the id of the tenant
1641-
* @see #newStatelessSession(String)
1642-
* @see #withSession(String, Function)
1643-
* @deprecated Will be removed before the final
1644-
*/
1645-
@Deprecated
1646-
StatelessSession openStatelessSession(String tenantId);
16471575

16481576
/**
16491577
* Perform work using a {@link Session reactive session}.

0 commit comments

Comments
 (0)