Class CosmosEntityInformation<T,ID>
java.lang.Object
org.springframework.data.repository.core.support.AbstractEntityInformation<T,ID>
com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation<T,ID>
- All Implemented Interfaces:
org.springframework.data.repository.core.EntityInformation<T,
,ID> org.springframework.data.repository.core.EntityMetadata<T>
public class CosmosEntityInformation<T,ID>
extends org.springframework.data.repository.core.support.AbstractEntityInformation<T,ID>
Class to describe cosmosDb entity
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet container nameGet the field represented by the supplied id field on the specified entity.Get id fieldGet id field nameGet id typeGet indexing policystatic CosmosEntityInformation<?,
?> getInstance
(Class<?> domainClass) Static FactorygetPartitionKeyFieldValue
(T entity) Get the field value represented by the supplied partitionKeyField object on the specified entity object.Get the computed partition key path for containerGet request unit valueGet timeToLive valueGets the UniqueKeyPolicyGet name of field annotated with @Version if anygetVersionFieldValue
(Object entity) Get the value of the field marked as the version fieldboolean
Check if auto creating container is allowedboolean
Check if container should use autoscale for resource unitsboolean
boolean
boolean
Check if is versionedboolean
Should generate Id field valueMethods inherited from class org.springframework.data.repository.core.support.AbstractEntityInformation
getJavaType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.repository.core.EntityInformation
getRequiredId
-
Constructor Details
-
CosmosEntityInformation
Initialization- Parameters:
domainType
- to specify id field
-
-
Method Details
-
getInstance
Static Factory- Parameters:
domainClass
- to specify id field- Returns:
- new CosmosEntityInformation
-
isNew
-
getId
Get the field represented by the supplied id field on the specified entity.- Parameters:
entity
- the target object from which to get the field- Returns:
- the id's current value
-
getIdField
Get id field- Returns:
- id
-
getIdFieldName
Get id field name- Returns:
- string
-
shouldGenerateId
public boolean shouldGenerateId()Should generate Id field value- Returns:
- boolean
-
getIdType
Get id type- Returns:
- class of id type
-
getContainerName
Get container name- Returns:
- container name
-
getRequestUnit
Get request unit value- Returns:
- request unit
-
getTimeToLive
Get timeToLive value- Returns:
- timeToLive
-
getIndexingPolicy
Get indexing policy- Returns:
- IndexingPolicy
-
getUniqueKeyPolicy
Gets the UniqueKeyPolicy- Returns:
- UniqueKeyPolicy
-
isVersioned
public boolean isVersioned()Check if is versioned- Returns:
- boolean
-
getVersionFieldName
Get name of field annotated with @Version if any- Returns:
- String
-
getPartitionKeyPath
Get the computed partition key path for container- Returns:
- partition key path
-
getVersionFieldValue
Get the value of the field marked as the version field- Parameters:
entity
- the object to get the value from- Returns:
- the value of the version field
-
getPartitionKeyFieldValue
Get the field value represented by the supplied partitionKeyField object on the specified entity object.- Parameters:
entity
- the target object from which to get the field- Returns:
- partition key field
-
getPartitionKeyFieldName
- Returns:
- the partition key field name
-
isAutoCreateContainer
public boolean isAutoCreateContainer()Check if auto creating container is allowed- Returns:
- boolean
-
isAutoScale
public boolean isAutoScale()Check if container should use autoscale for resource units- Returns:
- boolean
-
isIndexingPolicySpecified
public boolean isIndexingPolicySpecified()- Returns:
- whether indexing policy is specified
-