Skip to content

Support PersistTo, ReplicateTo and DurabilityLevel attributes on Document annotation. #1486

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

Closed
jorgerod opened this issue Jun 28, 2022 · 3 comments · Fixed by #1649
Closed
Labels
status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement

Comments

@jorgerod
Copy link
Contributor

jorgerod commented Jun 28, 2022

Hello

In some operationSupport, the values of PersistTo, ReplicateTo or DurabilityLevel are not configurable and the value NONE is always being used.

@Override
public <T> ReactiveReplaceById<T> replaceById(final Class<T> domainType) {
Assert.notNull(domainType, "DomainType must not be null!");
return new ReactiveReplaceByIdSupport<>(template, domainType, null, null, null, PersistTo.NONE, ReplicateTo.NONE,
DurabilityLevel.NONE, null, template.support());
}

@Override
public ReactiveRemoveById removeById(Class<?> domainType) {
return new ReactiveRemoveByIdSupport(template, domainType, OptionsBuilder.getScopeFrom(domainType),
OptionsBuilder.getCollectionFrom(domainType), null, PersistTo.NONE, ReplicateTo.NONE, DurabilityLevel.NONE,
null);
}

Is there any plan to support these values?

Thank you very much in advance

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 28, 2022
@mikereiche
Copy link
Collaborator

All the options are set with the fluent APIs. Just look a little further down that class at the two withDurability() methods.

public ReplaceByIdInScope<T> withDurability(final DurabilityLevel durabilityLevel) {

public ReplaceByIdInScope<T> withDurability(final PersistTo persistTo, final ReplicateTo replicateTo) {

@mikereiche mikereiche added status: feedback-provided Feedback has been provided and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 28, 2022
@jorgerod
Copy link
Contributor Author

Hi @mikereiche
Thank you very much for your quick response.

To use the fluent methods you mentioned, I would have to define the methods myself in my own repository (which is the approach I am taking).

My question/suggestion is that if SimpleReactiveCouchbaseRepository could take into account replicationPolicies by document type in methods like save, deleteById or delete and consequently ReactiveCouchbaseTemplate also take into account those values and use the fluent methods like withDurability you have commented.

This way, it would be transparent to the developer.

Thank you

@mikereiche
Copy link
Collaborator

could take into account replicationPolicies by document type

So you're asking to add an attribute to the @document annotation. (like Expiry). We can do that.

@mikereiche mikereiche changed the title Support PersistTo, ReplicateTo and DurabilityLevel in operations Support PersistTo, ReplicateTo and DurabilityLevel attributes on Document annotation. Jul 13, 2022
@mikereiche mikereiche added type: enhancement A general enhancement status: ideal-for-contribution An issue that a contributor can help us with and removed status: feedback-provided Feedback has been provided labels Jul 13, 2022
babltiga added a commit to babltiga/spring-data-couchbase that referenced this issue Jan 20, 2023
mikereiche pushed a commit to babltiga/spring-data-couchbase that referenced this issue Jan 24, 2023
mikereiche pushed a commit to babltiga/spring-data-couchbase that referenced this issue Jan 24, 2023
@mikereiche mikereiche added this to the 5.0.2 (2022.0.2) milestone Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants