Class DefaultMongoDatabaseNameProvider
- java.lang.Object
-
- io.micronaut.data.mongodb.operations.DefaultMongoDatabaseNameProvider
-
- All Implemented Interfaces:
MongoDatabaseNameProvider
@Internal public final class DefaultMongoDatabaseNameProvider extends java.lang.Object implements MongoDatabaseNameProvider
Internal implementation ofMongoDatabaseNameProvider.- Since:
- 3.9.0
-
-
Constructor Summary
Constructors Constructor Description DefaultMongoDatabaseNameProvider(io.micronaut.context.BeanContext beanContext, java.lang.String server, io.micronaut.data.model.runtime.RuntimeEntityRegistry runtimeEntityRegistry, java.lang.String defaultDatabaseName, io.micronaut.data.runtime.multitenancy.SchemaTenantResolver tenantResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringprovide(io.micronaut.data.model.PersistentEntity persistentEntity, java.lang.Class<?> repositoryClass)Provides the database name based on the persistent entity and the repository class.java.lang.Stringprovide(java.lang.Class<?> type)Provides the database name based on the persistent entity type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micronaut.data.mongodb.operations.MongoDatabaseNameProvider
provide
-
-
-
-
Constructor Detail
-
DefaultMongoDatabaseNameProvider
public DefaultMongoDatabaseNameProvider(io.micronaut.context.BeanContext beanContext, @Nullable java.lang.String server, io.micronaut.data.model.runtime.RuntimeEntityRegistry runtimeEntityRegistry, @Nullable java.lang.String defaultDatabaseName, @Nullable io.micronaut.data.runtime.multitenancy.SchemaTenantResolver tenantResolver)
-
-
Method Detail
-
provide
public java.lang.String provide(java.lang.Class<?> type)
Description copied from interface:MongoDatabaseNameProviderProvides the database name based on the persistent entity type.- Specified by:
providein interfaceMongoDatabaseNameProvider- Parameters:
type- The entity type- Returns:
- The collection name
-
provide
public java.lang.String provide(io.micronaut.data.model.PersistentEntity persistentEntity, java.lang.Class<?> repositoryClass)Description copied from interface:MongoDatabaseNameProviderProvides the database name based on the persistent entity and the repository class.- Specified by:
providein interfaceMongoDatabaseNameProvider- Parameters:
persistentEntity- The persistent entityrepositoryClass- The repository class used- Returns:
- The collection name
-
-