Interface DatabaseSchemaIdProvider

All Superinterfaces:
CdsProvider<DatabaseSchemaIdProvider>

@Beta public interface DatabaseSchemaIdProvider extends CdsProvider<DatabaseSchemaIdProvider>
Determines the database schema ID for the given UserInfo context. By default CAP uses the tenant ID (UserInfo.getTenant()) as database schema ID. This provider allows adjusting the mapping from UserInfo to database schema ID. Most commonly this is used in shared tenancy scenarios with discriminator column to allow multiple tenants to be mapped to the same database schema ID.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(UserInfo userInfo, String forBinding)
    Returns the database schema ID for the given UserInfo context.

    Methods inherited from interface com.sap.cds.services.runtime.CdsProvider

    setPrevious
  • Method Details

    • get

      String get(UserInfo userInfo, String forBinding)
      Returns the database schema ID for the given UserInfo context.
      Parameters:
      userInfo - the UserInfo
      forBinding - the name of the binding (from which the multitenant DataSource was created)
      Returns:
      the database schema ID