Package io.micronaut.data.cosmos.common
Class CosmosEntity
java.lang.Object
io.micronaut.data.cosmos.common.CosmosEntity
Model holding cosmos entity fields like container name, partition key, version field.
- Since:
- 3.9.0
- Author:
- radovanradic
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull CosmosEntity
create
(@NonNull RuntimePersistentEntity<?> runtimePersistentEntity, CosmosDatabaseConfiguration.CosmosContainerSettings cosmosContainerSettings) static @NonNull CosmosEntity
get
(@NonNull RuntimePersistentEntity<?> runtimePersistentEntity) GetsCosmosEntity
that was initialized during app startup for givenRuntimePersistentEntity
.
-
Method Details
-
getContainerName
- Returns:
- the Cosmos container name for this entity
-
getPartitionKey
- Returns:
- the partition key for the Cosmos container/entity
-
getVersionField
- Returns:
- the version field, if any defined on the entity using
ETag
annotation
-
create
@NonNull public static @NonNull CosmosEntity create(@NonNull @NonNull RuntimePersistentEntity<?> runtimePersistentEntity, CosmosDatabaseConfiguration.CosmosContainerSettings cosmosContainerSettings) CreatesCosmosEntity
fromRuntimePersistentEntity
andCosmosDatabaseConfiguration.CosmosContainerSettings
.- Parameters:
runtimePersistentEntity
- the runtime persistent entitycosmosContainerSettings
- the Cosmos container settings- Returns:
- the
CosmosEntity
holding mapped entity/container metadata
-
get
@NonNull public static @NonNull CosmosEntity get(@NonNull @NonNull RuntimePersistentEntity<?> runtimePersistentEntity) GetsCosmosEntity
that was initialized during app startup for givenRuntimePersistentEntity
.- Parameters:
runtimePersistentEntity
- the runtime persistent entity- Returns:
- the
CosmosEntity
holding mapped entity/container metadata
-