Class CockroachRowLevelSecurity
java.lang.Object
org.hibernate.dialect.rowsecurity.CockroachRowLevelSecurity
- All Implemented Interfaces:
RowLevelSecurity
Row-level security support for CockroachDB.
-
Nested Class Summary
Nested classes/interfaces inherited from interface RowLevelSecurity
RowLevelSecurity.TenantIdentifierSource -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final CockroachRowLevelSecuritystatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]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
addTenantIdTableInitCommands, supportsTenantIdentifierSource
-
Field Details
-
INSTANCE
-
APPLICATION_NAME_SETTING
- See Also:
-
APPLICATION_NAME_PREFIX
- See Also:
-
TENANT_ISOLATION_POLICY
- See Also:
-
-
Constructor Details
-
CockroachRowLevelSecurity
public CockroachRowLevelSecurity()
-
-
Method Details
-
supportsRowLevelSecurity
public boolean supportsRowLevelSecurity()Description copied from interface:RowLevelSecurityDoes this dialect natively support row-level security?- Specified by:
supportsRowLevelSecurityin interfaceRowLevelSecurity
-
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
-