public interface TenantProvider
Interface for providing row-level multi-tenancy support. Implementations of this interface define how tenant
information is retrieved and applied to SQL queries.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringRetrieves the name of the tenant field.net.sf.jsqlparser.expression.ExpressionRetrieves the tenant ID value as anExpression.default booleanDetermines whether to ignore multi-tenancy conditions for a specific table.default booleanDetermines whether to ignore inserting the tenant field during an INSERT operation.
-
Method Details
-
getTenantId
net.sf.jsqlparser.expression.Expression getTenantId()Retrieves the tenant ID value as anExpression. This method should only support a single tenant ID value.- Returns:
- the tenant ID expression
-
getColumn
Retrieves the name of the tenant field.- Returns:
- the tenant field name, defaulting to "tenant_id"
-
ignore
Determines whether to ignore multi-tenancy conditions for a specific table.- Parameters:
name- the name of the table- Returns:
- true to ignore, false to apply tenant conditions
-
ignore
Determines whether to ignore inserting the tenant field during an INSERT operation. This is typically used to check if the tenant column is already present in the list of columns.- Parameters:
columns- the list of columns in the INSERT statementcolumn- the name of the tenant ID field- Returns:
- true to ignore, false to insert the tenant field
-