Class DB2RowLevelSecurity
java.lang.Object
org.hibernate.dialect.rowsecurity.DB2RowLevelSecurity
- All Implemented Interfaces:
RowLevelSecurity
Row-level security support for Db2 row and column access control.
-
Nested Class Summary
Nested classes/interfaces inherited from interface RowLevelSecurity
RowLevelSecurity.TenantIdentifierSource -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTenantIdTableInitCommands(InFlightMetadataCollector collector, Table table, Column tenantIdentifierColumn, Metadata metadata, RowLevelSecurity.TenantIdentifierSource tenantIdentifierSource) Register table initialization commands enforcing discriminator-based multitenancy via native row-level security.String[]getTenantIdTableCreateStrings(Table table, Column tenantIdentifierColumn, Metadata metadata, SqlStringGenerationContext context, RowLevelSecurity.TenantIdentifierSource tenantIdentifierSource) Create the DDL commands which enforce discriminator-based multitenancy via native row-level security.voidsetTenantIdentifier(Connection connection, String tenantIdentifier, boolean root) Apply the current Hibernate tenant identifier to the database connection.booleanDoes this dialect natively support row-level security?Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RowLevelSecurity
supportsTenantIdentifierSource
-
Field Details
-
INSTANCE
-
TENANT_IDENTIFIER_VARIABLE
- See Also:
-
ROOT_TENANT_IDENTIFIER_VARIABLE
- See Also:
-
TENANT_ISOLATION_PERMISSION
- See Also:
-
SET_TENANT_SQL
-
SET_ROOT_TENANT_SQL
-
UUID_PREDICATE_SQL
-
PREDICATE_SQL
-
CURRENT_USER_UUID_PREDICATE_SQL
- See Also:
-
CURRENT_USER_PREDICATE_SQL
- See Also:
-
-
Constructor Details
-
DB2RowLevelSecurity
public DB2RowLevelSecurity()
-
-
Method Details
-
supportsRowLevelSecurity
public boolean supportsRowLevelSecurity()Description copied from interface:RowLevelSecurityDoes this dialect natively support row-level security?- Specified by:
supportsRowLevelSecurityin interfaceRowLevelSecurity
-
addTenantIdTableInitCommands
public void addTenantIdTableInitCommands(InFlightMetadataCollector collector, Table table, Column tenantIdentifierColumn, Metadata metadata, RowLevelSecurity.TenantIdentifierSource tenantIdentifierSource) Description copied from interface:RowLevelSecurityRegister table initialization commands enforcing discriminator-based multitenancy via native row-level security.- Specified by:
addTenantIdTableInitCommandsin interfaceRowLevelSecurity- Parameters:
collector- The metadata collectortable- The table containing the tenant id columntenantIdentifierColumn- The tenant id columnmetadata- The mapping metadatatenantIdentifierSource- The source used to resolve the tenant id
-
getTenantIdTableCreateStrings
public String[] getTenantIdTableCreateStrings(Table table, Column tenantIdentifierColumn, Metadata metadata, SqlStringGenerationContext context, RowLevelSecurity.TenantIdentifierSource tenantIdentifierSource) Description copied from interface:RowLevelSecurityCreate the DDL commands which enforce discriminator-based multitenancy via native row-level security.- Specified by:
getTenantIdTableCreateStringsin interfaceRowLevelSecurity- Parameters:
table- The table containing the tenant id columntenantIdentifierColumn- The tenant id columnmetadata- The mapping metadatacontext- SQL rendering contexttenantIdentifierSource- The source used to resolve the tenant id
-
setTenantIdentifier
public void setTenantIdentifier(Connection connection, String tenantIdentifier, boolean root) throws SQLException Description copied from interface:RowLevelSecurityApply the current Hibernate tenant identifier to the database connection. Dialects may use this to populate session-local state referenced by their row-level security policies.- Specified by:
setTenantIdentifierin interfaceRowLevelSecurity- Parameters:
connection- The JDBC connectiontenantIdentifier- The tenant identifier rendered as a stringroot- Whether the tenant identifier is a root tenant- Throws:
SQLException
-