Skip to content

DATACOUCH-630 Add expiry option to replace. #285

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

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

mikereiche
Copy link
Collaborator

Add expiry option to 'replace' similar to how it is on 'insert' and 'update'

  • You have read the Spring Data contribution guidelines.
  • There is a ticket in the bug tracker for the project in our JIRA.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

@mikereiche mikereiche requested a review from daschl December 8, 2020 18:40
@mikereiche mikereiche changed the base branch from master to 4.0.x December 8, 2020 18:44
@mikereiche mikereiche force-pushed the datacouch_630_add_expiry_to_replace branch from 4f9d18e to 82b6d4b Compare December 8, 2020 18:48
options.expiry(expiry);
} else if (domainType.isAnnotationPresent(Document.class)) {
Document documentAnn = domainType.getAnnotation(Document.class);
long durationSeconds = documentAnn.expiryUnit().toSeconds(documentAnn.expiry());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could some of these values (like the expiry unit be null and cause a NPE if not set?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document annotation has a default expiryUnit of SECONDS and a default expiry of 0

Copy link
Contributor

@daschl daschl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+2, but with a comment on a potential NPE . if that is a no-issue feel free to merge

@mikereiche mikereiche merged commit 7aeb5e4 into 4.0.x Dec 9, 2020
@mikereiche mikereiche deleted the datacouch_630_add_expiry_to_replace branch December 14, 2020 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants