Skip to content

Commit 73595ed

Browse files
committed
HHH-19708 improve Javadoc for MultiTenancy util class
1 parent 0554b0a commit 73595ed

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

hibernate-core/src/main/java/org/hibernate/context/spi/MultiTenancy.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
import static org.hibernate.cfg.MultiTenancySettings.MULTI_TENANT_SCHEMA_MAPPER;
1818

1919
/**
20-
* Exposes useful strategy objects to user-written components, for example,
21-
* to a custom implementation of {@link MultiTenantConnectionProvider}.
20+
* Exposes useful multitenancy-related strategy objects to user-written components.
21+
* <p>
22+
* The operation {@link #getTenantSchemaMapper} is especially useful in any custom
23+
* implementation of {@link MultiTenantConnectionProvider} which takes on responsibility
24+
* for {@linkplain MultiTenantConnectionProvider#handlesConnectionSchema setting the schema}.
2225
*
2326
* @since 7.1
2427
*
@@ -27,10 +30,16 @@
2730
@Incubating
2831
public class MultiTenancy {
2932

33+
/**
34+
* Is a {@link MultiTenantConnectionProvider} available?
35+
*/
3036
public static boolean isMultiTenancyEnabled(ServiceRegistry serviceRegistry) {
3137
return serviceRegistry.getService( MultiTenantConnectionProvider.class ) != null;
3238
}
3339

40+
/**
41+
* Obtain the configured {@link CurrentTenantIdentifierResolver}.
42+
*/
3443
@SuppressWarnings("unchecked")
3544
public static CurrentTenantIdentifierResolver<Object> getTenantIdentifierResolver(
3645
Map<String,Object> settings, StandardServiceRegistry registry) {
@@ -52,6 +61,9 @@ public static CurrentTenantIdentifierResolver<Object> getTenantIdentifierResolve
5261
}
5362
}
5463

64+
/**
65+
* Obtain the configured {@link TenantSchemaMapper}.
66+
*/
5567
@SuppressWarnings("unchecked")
5668
public static TenantSchemaMapper<Object> getTenantSchemaMapper(
5769
Map<String,Object> settings, StandardServiceRegistry registry) {

0 commit comments

Comments
 (0)