Interface MongoDatabaseNameProvider

All Known Implementing Classes:
DefaultMongoDatabaseNameProvider

public interface MongoDatabaseNameProvider
MongoDB database name provider.
Since:
3.9.0
Author:
Denis Stepanov
  • Method Summary

    Modifier and Type
    Method
    Description
    default @NonNull String
    provide(@NonNull PersistentEntity persistentEntity)
    Provides the database name based on the persistent entity and the repository class.
    @NonNull String
    provide(@NonNull PersistentEntity persistentEntity, @Nullable Class<?> repositoryClass)
    Provides the database name based on the persistent entity and the repository class.
    @NonNull String
    provide(@NonNull Class<?> type)
    Provides the database name based on the persistent entity type.
  • Method Details

    • provide

      @NonNull @NonNull String provide(@NonNull @NonNull PersistentEntity persistentEntity, @Nullable @Nullable Class<?> repositoryClass)
      Provides the database name based on the persistent entity and the repository class.
      Parameters:
      persistentEntity - The persistent entity
      repositoryClass - The repository class used
      Returns:
      The collection name
    • provide

      @NonNull @NonNull String provide(@NonNull @NonNull Class<?> type)
      Provides the database name based on the persistent entity type.
      Parameters:
      type - The entity type
      Returns:
      The collection name
    • provide

      @NonNull default @NonNull String provide(@NonNull @NonNull PersistentEntity persistentEntity)
      Provides the database name based on the persistent entity and the repository class.
      Parameters:
      persistentEntity - The persistent entity
      Returns:
      The collection name