Class DB2RowLevelSecurity

java.lang.Object
org.hibernate.dialect.rowsecurity.DB2RowLevelSecurity
All Implemented Interfaces:
RowLevelSecurity

public class DB2RowLevelSecurity extends Object implements RowLevelSecurity
Row-level security support for Db2 row and column access control.
  • Field Details

    • INSTANCE

      public static final DB2RowLevelSecurity INSTANCE
    • TENANT_IDENTIFIER_VARIABLE

      public static final String TENANT_IDENTIFIER_VARIABLE
      See Also:
    • ROOT_TENANT_IDENTIFIER_VARIABLE

      public static final String ROOT_TENANT_IDENTIFIER_VARIABLE
      See Also:
    • TENANT_ISOLATION_PERMISSION

      public static final String TENANT_ISOLATION_PERMISSION
      See Also:
    • SET_TENANT_SQL

      public static final String SET_TENANT_SQL
    • SET_ROOT_TENANT_SQL

      public static final String SET_ROOT_TENANT_SQL
    • UUID_PREDICATE_SQL

      public static final String UUID_PREDICATE_SQL
    • PREDICATE_SQL

      public static final String PREDICATE_SQL
    • CURRENT_USER_UUID_PREDICATE_SQL

      public static final String CURRENT_USER_UUID_PREDICATE_SQL
      See Also:
    • CURRENT_USER_PREDICATE_SQL

      public static final String CURRENT_USER_PREDICATE_SQL
      See Also:
  • Constructor Details

    • DB2RowLevelSecurity

      public DB2RowLevelSecurity()
  • Method Details

    • supportsRowLevelSecurity

      public boolean supportsRowLevelSecurity()
      Description copied from interface: RowLevelSecurity
      Does this dialect natively support row-level security?
      Specified by:
      supportsRowLevelSecurity in interface RowLevelSecurity
    • addTenantIdTableInitCommands

      public void addTenantIdTableInitCommands(InFlightMetadataCollector collector, Table table, Column tenantIdentifierColumn, Metadata metadata, RowLevelSecurity.TenantIdentifierSource tenantIdentifierSource)
      Description copied from interface: RowLevelSecurity
      Register table initialization commands enforcing discriminator-based multitenancy via native row-level security.
      Specified by:
      addTenantIdTableInitCommands in interface RowLevelSecurity
      Parameters:
      collector - The metadata collector
      table - The table containing the tenant id column
      tenantIdentifierColumn - The tenant id column
      metadata - The mapping metadata
      tenantIdentifierSource - 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: RowLevelSecurity
      Create the DDL commands which enforce discriminator-based multitenancy via native row-level security.
      Specified by:
      getTenantIdTableCreateStrings in interface RowLevelSecurity
      Parameters:
      table - The table containing the tenant id column
      tenantIdentifierColumn - The tenant id column
      metadata - The mapping metadata
      context - SQL rendering context
      tenantIdentifierSource - The source used to resolve the tenant id
    • setTenantIdentifier

      public void setTenantIdentifier(Connection connection, String tenantIdentifier, boolean root) throws SQLException
      Description copied from interface: RowLevelSecurity
      Apply 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:
      setTenantIdentifier in interface RowLevelSecurity
      Parameters:
      connection - The JDBC connection
      tenantIdentifier - The tenant identifier rendered as a string
      root - Whether the tenant identifier is a root tenant
      Throws:
      SQLException