File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
hibernate-core/src/main/java/org/hibernate/context/spi Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 17
17
import static org .hibernate .cfg .MultiTenancySettings .MULTI_TENANT_SCHEMA_MAPPER ;
18
18
19
19
/**
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}.
22
25
*
23
26
* @since 7.1
24
27
*
27
30
@ Incubating
28
31
public class MultiTenancy {
29
32
33
+ /**
34
+ * Is a {@link MultiTenantConnectionProvider} available?
35
+ */
30
36
public static boolean isMultiTenancyEnabled (ServiceRegistry serviceRegistry ) {
31
37
return serviceRegistry .getService ( MultiTenantConnectionProvider .class ) != null ;
32
38
}
33
39
40
+ /**
41
+ * Obtain the configured {@link CurrentTenantIdentifierResolver}.
42
+ */
34
43
@ SuppressWarnings ("unchecked" )
35
44
public static CurrentTenantIdentifierResolver <Object > getTenantIdentifierResolver (
36
45
Map <String ,Object > settings , StandardServiceRegistry registry ) {
@@ -52,6 +61,9 @@ public static CurrentTenantIdentifierResolver<Object> getTenantIdentifierResolve
52
61
}
53
62
}
54
63
64
+ /**
65
+ * Obtain the configured {@link TenantSchemaMapper}.
66
+ */
55
67
@ SuppressWarnings ("unchecked" )
56
68
public static TenantSchemaMapper <Object > getTenantSchemaMapper (
57
69
Map <String ,Object > settings , StandardServiceRegistry registry ) {
You can’t perform that action at this time.
0 commit comments