Class CockroachRowLevelSecurity

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

public class CockroachRowLevelSecurity extends Object implements RowLevelSecurity
Row-level security support for CockroachDB.
  • Field Details

  • Constructor Details

    • CockroachRowLevelSecurity

      public CockroachRowLevelSecurity()
  • 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
    • 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