-
Notifications
You must be signed in to change notification settings - Fork 192
Support an @Expiry, @Expiration or @TTL annotation #1060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Being able to annotate a field to nominate it as containing the expiry value would also allow programmatic control of expiry when using a Repository. User user = new User();
user.setExpiry(Duration.ofHours(1));
userRepository.save(user); Analogous to: template.insertById(User.class)
.withExpiry(Duration.ofHours(1))
.one(user); |
Should be supported with #1149 in org.springframework.data:spring-data-couchbase:4.3.0-M2 by:
|
So if the entity already has a field annotated with @Expiration, what is the purpose of specifying the expiry via options? Shouldn't we just read the value of the field? There is a lack of symmetry here... Then there is also the issue of type conversion, what types does @Expiration support? I see |
Just like we have
@Field
@Id
and@Version
support, it would be good to have a field to read the document expiry value from.This field should support being of the type
int
,long
,Duration
and some subset of classes fromjava.time.*
.The text was updated successfully, but these errors were encountered: