Module bus.pager

Interface TenantProvider


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 Type
    Method
    Description
    default String
    Retrieves the name of the tenant field.
    net.sf.jsqlparser.expression.Expression
    Retrieves the tenant ID value as an Expression.
    default boolean
    ignore(String name)
    Determines whether to ignore multi-tenancy conditions for a specific table.
    default boolean
    ignore(List<net.sf.jsqlparser.schema.Column> columns, String column)
    Determines 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 an Expression. This method should only support a single tenant ID value.
      Returns:
      the tenant ID expression
    • getColumn

      default String getColumn()
      Retrieves the name of the tenant field.
      Returns:
      the tenant field name, defaulting to "tenant_id"
    • ignore

      default boolean ignore(String name)
      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

      default boolean ignore(List<net.sf.jsqlparser.schema.Column> columns, String column)
      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 statement
      column - the name of the tenant ID field
      Returns:
      true to ignore, false to insert the tenant field