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
-
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 TypeMethodDescriptionint
Deprecated.static int
getExpiry
(Expiry annotation, Environment environment) Deprecated.Returns the expiration time of the entity.boolean
boolean
Flag for using getAndTouch operations for reads, resetting the expiration (if one was set) when the entity is directly read (eg. findOne, findById).protected CouchbasePersistentProperty
void
setEnvironment
(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, getVersionProperty, hasIdProperty, hasVersionProperty, isAnnotationPresent, isCreatorArgument, isIdProperty, isImmutable, isNew, isVersionProperty, iterator, requiresPropertyPopulation, setEvaluationContextProvider, setPersistentPropertyAccessorFactory, verify
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods 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:
setEnvironment
in interfaceEnvironmentAware
-
returnPropertyIfBetterIdPropertyCandidateOrNull
protected CouchbasePersistentProperty returnPropertyIfBetterIdPropertyCandidateOrNull(CouchbasePersistentProperty property) - Overrides:
returnPropertyIfBetterIdPropertyCandidateOrNull
in classBasicPersistentEntity<T,
CouchbasePersistentProperty>
-
getExpiry
Deprecated.Description copied from interface:CouchbasePersistentEntity
Returns 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:
getExpiry
in interfaceCouchbasePersistentEntity<T>
- Returns:
- the expiration time in correct Couchbase format.
-
getExpiry
Deprecated. -
getExpiryDuration
Description copied from interface:CouchbasePersistentEntity
Returns 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:
getExpiryDuration
in interfaceCouchbasePersistentEntity<T>
- Returns:
- the expiration time Duration
-
isTouchOnRead
public boolean isTouchOnRead()Description copied from interface:CouchbasePersistentEntity
Flag for using getAndTouch operations for reads, resetting the expiration (if one was set) when the entity is directly read (eg. findOne, findById).- Specified by:
isTouchOnRead
in 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:
hasTextScoreProperty
in interfaceCouchbasePersistentEntity<T>
-
getTextScoreProperty
- Specified by:
getTextScoreProperty
in interfaceCouchbasePersistentEntity<T>
-