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
Constructors Constructor Description CosmosEntityInformation(Class<T> domainType)Initialization
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContainerName()Get container nameIDgetId(T entity)Get the field represented by the supplied id field on the specified entity.FieldgetIdField()Get id fieldStringgetIdFieldName()Get id field nameClass<ID>getIdType()Get id typeIndexingPolicygetIndexingPolicy()Get indexing policystatic CosmosEntityInformation<?,?>getInstance(Class<?> domainClass)Static FactoryStringgetPartitionKeyFieldName()ObjectgetPartitionKeyFieldValue(T entity)Get the field value represented by the supplied partitionKeyField object on the specified entity object.StringgetPartitionKeyPath()Get the computed partition key path for containerIntegergetRequestUnit()Get request unit valueIntegergetTimeToLive()Get timeToLive valueUniqueKeyPolicygetUniqueKeyPolicy()Gets the UniqueKeyPolicyStringgetVersionFieldName()Get name of field annotated with @Version if anyStringgetVersionFieldValue(Object entity)Get the value of the field marked as the version fieldbooleanisAutoCreateContainer()Check if auto creating container is allowedbooleanisAutoScale()Check if container should use autoscale for resource unitsbooleanisIndexingPolicySpecified()booleanisNew(T entity)booleanisVersioned()Check if is versionedbooleanshouldGenerateId()Should generate Id field value-
Methods inherited from class org.springframework.data.repository.core.support.AbstractEntityInformation
getJavaType
-
-
-
-
Method Detail
-
getInstance
public static CosmosEntityInformation<?,?> getInstance(Class<?> domainClass)
Static Factory- Parameters:
domainClass- to specify id field- Returns:
- new CosmosEntityInformation
-
isNew
public boolean isNew(T entity)
-
getId
public ID getId(T entity)
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
public Field getIdField()
Get id field- Returns:
- id
-
getIdFieldName
public String getIdFieldName()
Get id field name- Returns:
- string
-
shouldGenerateId
public boolean shouldGenerateId()
Should generate Id field value- Returns:
- boolean
-
getContainerName
public String getContainerName()
Get container name- Returns:
- container name
-
getRequestUnit
public Integer getRequestUnit()
Get request unit value- Returns:
- request unit
-
getTimeToLive
public Integer getTimeToLive()
Get timeToLive value- Returns:
- timeToLive
-
getIndexingPolicy
@NonNull public IndexingPolicy getIndexingPolicy()
Get indexing policy- Returns:
- IndexingPolicy
-
getUniqueKeyPolicy
public UniqueKeyPolicy getUniqueKeyPolicy()
Gets the UniqueKeyPolicy- Returns:
- UniqueKeyPolicy
-
isVersioned
public boolean isVersioned()
Check if is versioned- Returns:
- boolean
-
getVersionFieldName
public String getVersionFieldName()
Get name of field annotated with @Version if any- Returns:
- String
-
getPartitionKeyPath
public String getPartitionKeyPath()
Get the computed partition key path for container- Returns:
- partition key path
-
getVersionFieldValue
public String getVersionFieldValue(Object entity)
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
public Object getPartitionKeyFieldValue(T entity)
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
public String 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
-
-