Class BasicCouchbasePersistentEntity<T>
java.lang.Object
org.springframework.data.mapping.model.BasicPersistentEntity<T,CouchbasePersistentProperty>
org.springframework.data.couchbase.core.mapping.BasicCouchbasePersistentEntity<T>
- All Implemented Interfaces:
Iterable<CouchbasePersistentProperty>,Aware,EnvironmentAware,CouchbasePersistentEntity<T>,MutablePersistentEntity<T,,CouchbasePersistentProperty> PersistentEntity<T,CouchbasePersistentProperty>
public class BasicCouchbasePersistentEntity<T>
extends BasicPersistentEntity<T,CouchbasePersistentProperty>
implements CouchbasePersistentEntity<T>, EnvironmentAware
The representation of a persistent entity.
- Author:
- Michael Nitschinger, Mark Paluch, Michael Reiche, Tigran Babloyan
-
Field Summary
Fields inherited from interface org.springframework.data.couchbase.core.mapping.CouchbasePersistentEntity
TTL_IN_SECONDS_INCLUSIVE_END -
Constructor Summary
ConstructorsConstructorDescriptionBasicCouchbasePersistentEntity(TypeInformation<T> typeInformation) Create a new entity. -
Method Summary
Modifier and TypeMethodDescriptioncom.couchbase.client.core.msg.kv.DurabilityLevelReturns the durability level of the entity.intDeprecated.static intgetExpiry(Expiry annotation, Environment environment) Deprecated.Returns the expiration time of the entity.booleanbooleanFlag for using getAndTouch operations for reads, resetting the expiration (if one was set) when the entity is directly read (eg. findOne, findById).protected CouchbasePersistentPropertyvoidsetEnvironment(Environment environment) Methods inherited from class org.springframework.data.mapping.model.BasicPersistentEntity
addAssociation, addPersistentProperty, doWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getEvaluationContext, getEvaluationContext, getFallbackIsNewStrategy, getIdentifierAccessor, getIdProperty, getInstanceCreatorMetadata, getName, getPersistenceConstructor, getPersistentProperties, getPersistentProperty, getPropertyAccessor, getPropertyPathAccessor, getType, getTypeAlias, getTypeInformation, getValueEvaluationContext, getValueEvaluationContext, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isCreatorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, iterator, requiresPropertyPopulation, setEvaluationContextProvider, setPersistentPropertyAccessorFactory, verifyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.springframework.data.mapping.PersistentEntity
doWithAll, doWithAssociations, doWithAssociations, doWithProperties, doWithProperties, findAnnotation, getIdentifierAccessor, getIdProperty, getInstanceCreatorMetadata, getName, getPersistenceConstructor, getPersistentProperties, getPersistentProperty, getPersistentProperty, getPropertyAccessor, getPropertyPathAccessor, getRequiredAnnotation, getRequiredIdProperty, getRequiredPersistentProperty, getRequiredVersionProperty, getType, getTypeAlias, getTypeInformation, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isConstructorArgument, isCreatorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, requiresPropertyPopulation
-
Constructor Details
-
BasicCouchbasePersistentEntity
Create a new entity.- Parameters:
typeInformation- the type information of the entity.
-
-
Method Details
-
setEnvironment
- Specified by:
setEnvironmentin interfaceEnvironmentAware- Overrides:
setEnvironmentin classBasicPersistentEntity<T,CouchbasePersistentProperty>
-
returnPropertyIfBetterIdPropertyCandidateOrNull
protected CouchbasePersistentProperty returnPropertyIfBetterIdPropertyCandidateOrNull(CouchbasePersistentProperty property) - Overrides:
returnPropertyIfBetterIdPropertyCandidateOrNullin classBasicPersistentEntity<T,CouchbasePersistentProperty>
-
getExpiry
Deprecated.Description copied from interface:CouchbasePersistentEntityReturns the expiration time of the entity.The Couchbase format for expiration time is: - for TTL < 31 days (<= 30 * 24 * 60 * 60): expressed as a TTL in seconds - for TTL > 30 days: expressed as Unix UTC time of expiry (number of SECONDS since the Epoch)
- Specified by:
getExpiryin interfaceCouchbasePersistentEntity<T>- Returns:
- the expiration time in correct Couchbase format.
-
getExpiry
Deprecated. -
getExpiryDuration
Description copied from interface:CouchbasePersistentEntityReturns the expiration time of the entity.The Couchbase format for expiration time is: - for TTL < 31 days (<= 30 * 24 * 60 * 60): expressed as a TTL in seconds - for TTL > 30 days: expressed as Unix UTC time of expiry (number of SECONDS since the Epoch)
- Specified by:
getExpiryDurationin interfaceCouchbasePersistentEntity<T>- Returns:
- the expiration time Duration
-
getDurabilityLevel
public com.couchbase.client.core.msg.kv.DurabilityLevel getDurabilityLevel()Description copied from interface:CouchbasePersistentEntityReturns the durability level of the entity.Allows the application to wait until this replication (or persistence) is successful before proceeding
- Specified by:
getDurabilityLevelin interfaceCouchbasePersistentEntity<T>- Returns:
- the durability level.
-
isTouchOnRead
public boolean isTouchOnRead()Description copied from interface:CouchbasePersistentEntityFlag for using getAndTouch operations for reads, resetting the expiration (if one was set) when the entity is directly read (eg. findOne, findById).- Specified by:
isTouchOnReadin interfaceCouchbasePersistentEntity<T>- Returns:
- true if a direct read of the document should trigger a touch, resetting its expiration timer.
-
hasTextScoreProperty
public boolean hasTextScoreProperty()- Specified by:
hasTextScorePropertyin interfaceCouchbasePersistentEntity<T>
-
getTextScoreProperty
- Specified by:
getTextScorePropertyin interfaceCouchbasePersistentEntity<T>
-