CosmosEntityInformation<T,ID> Class
- java.
lang. Object - org.
springframework. data. repository. core. support. AbstractEntityInformation - com.
azure. spring. data. cosmos. repository. support. CosmosEntityInformation<T,ID>
- com.
- org.
Type Parameters
- T
domain type.
- ID
id type.
public class CosmosEntityInformation<T,ID>
extends org.springframework.data.repository.core.support.AbstractEntityInformation<T,ID>
Class to describe cosmosDb entity
Constructor Summary
Constructor | Description |
---|---|
CosmosEntityInformation(Class<T> domainType) |
Initialization |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
getContainerName()
Get container name |
ID |
getId(T entity)
Get the field represented by the supplied id field on the specified entity. |
Field |
getIdField()
Get id field |
String |
getIdFieldName()
Get id field name |
Class<ID> |
getIdType()
Get id type |
Indexing |
getIndexingPolicy()
Get indexing policy |
static
Cosmos |
getInstance(Class<?> domainClass)
Static Factory |
String |
getPartitionKeyFieldName()
Return the partition key field name. |
Object |
getPartitionKeyFieldValue(T entity)
Get the field value represented by the supplied partition |
String |
getPartitionKeyPath()
Get the computed partition key path for container |
Integer |
getRequestUnit()
Get request unit value |
Integer |
getTimeToLive()
Get time |
List<String> |
getTransientFields()
Get transient field list |
Unique |
getUniqueKeyPolicy()
Gets the Unique |
String |
getVersionFieldName()
Get name of field annotated with @Version if any |
String |
getVersionFieldValue(Object entity)
Get the value of the field marked as the version field |
boolean |
isAutoCreateContainer()
Check if auto creating container is allowed |
boolean |
isAutoScale()
Check if container should use autoscale for resource units |
boolean |
isIndexingPolicySpecified()
Return whether indexing policy is specified. |
boolean | isNew(T entity) |
boolean |
isOverwriteIndexingPolicy()
Check if overwrite indexing policy is enabled |
boolean |
isVersioned()
Check if is versioned |
boolean |
shouldGenerateId()
Should generate Id field value |
Methods inherited from java.lang.Object
Methods inherited from org.springframework.data.repository.core.support.AbstractEntityInformation
Constructor Details
CosmosEntityInformation
public CosmosEntityInformation(Class
Initialization
Parameters:
Method Details
getContainerName
public String getContainerName()
Get container name
Returns:
getId
public ID getId(T entity)
Get the field represented by the supplied id field on the specified entity.
Parameters:
Returns:
getIdField
public Field getIdField()
Get id field
Returns:
getIdFieldName
public String getIdFieldName()
Get id field name
Returns:
getIdType
public Class
Get id type
Returns:
getIndexingPolicy
public IndexingPolicy getIndexingPolicy()
Get indexing policy
Returns:
getInstance
public static CosmosEntityInformation getInstance(Class domainClass)
Static Factory
Parameters:
Returns:
getPartitionKeyFieldName
public String getPartitionKeyFieldName()
Return the partition key field name.
Returns:
getPartitionKeyFieldValue
public Object getPartitionKeyFieldValue(T entity)
Get the field value represented by the supplied partitionKeyField object on the specified entity object.
Parameters:
Returns:
getPartitionKeyPath
public String getPartitionKeyPath()
Get the computed partition key path for container
Returns:
getRequestUnit
public Integer getRequestUnit()
Get request unit value
Returns:
getTimeToLive
public Integer getTimeToLive()
Get timeToLive value
Returns:
getTransientFields
public List
Get transient field list
Returns:
getUniqueKeyPolicy
public UniqueKeyPolicy getUniqueKeyPolicy()
Gets the UniqueKeyPolicy
Returns:
getVersionFieldName
public String getVersionFieldName()
Get name of field annotated with @Version if any
Returns:
getVersionFieldValue
public String getVersionFieldValue(Object entity)
Get the value of the field marked as the version field
Parameters:
Returns:
isAutoCreateContainer
public boolean isAutoCreateContainer()
Check if auto creating container is allowed
Returns:
isAutoScale
public boolean isAutoScale()
Check if container should use autoscale for resource units
Returns:
isIndexingPolicySpecified
public boolean isIndexingPolicySpecified()
Return whether indexing policy is specified.
Returns:
isNew
public boolean isNew(T entity)
Overrides:
CosmosEntityInformation<T,ID>.isNew(T entity)Parameters:
isOverwriteIndexingPolicy
public boolean isOverwriteIndexingPolicy()
Check if overwrite indexing policy is enabled
Returns:
isVersioned
public boolean isVersioned()
Check if is versioned
Returns:
shouldGenerateId
public boolean shouldGenerateId()
Should generate Id field value
Returns:
Applies to
Azure SDK for Java