Interface StatementFactory.KeyspaceProvider

Enclosing class:
StatementFactory
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface StatementFactory.KeyspaceProvider
Strategy interface to determine a keyspace for a given CassandraPersistentEntity and tableName. Classes implementing this interface can choose to return a keyspace or null to use the default keyspace.
Since:
4.4
Author:
Mark Paluch, John Blum, Sam Lightfoot
  • Method Details

    • session

      Use the current session keyspace.
      Since:
      5.0
    • entity

      Use the keyspace that is associated with the entity.
      Since:
      5.0
    • getKeyspace

      @Nullable com.datastax.oss.driver.api.core.CqlIdentifier getKeyspace(CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName)
      Determine a keyspace for a given CassandraPersistentEntity and tableName.
      Parameters:
      entity - the persistent entity for which the operation is applied.
      tableName - the table of the operation.
      Returns:
      a keyspace to use a dedicated keyspace for a Statement or null to use the default session keyspace.