Skip to content
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

Adding changeStrategy to AggregateRoot or Refereance aggregate and add information about change type to referenced aggregate #1383

Closed
Husan opened this issue Nov 16, 2022 · 1 comment
Assignees
Labels
status: duplicate A duplicate of another issue

Comments

@Husan
Copy link

Husan commented Nov 16, 2022

  1. Use upserts on Bs and only delete those not longer present
  2. have an attribute carrying change type information information

I think that the 1 st option must be default behavior or may be switched on by some annotation on Aggregate Root.
2 nd option may be must be behavior when developer define which row must be updated which insert and which must be deleted. May be similar to isNew function must be changeOperation(or changeType) function in child aggregate which must be implemented from some interfays(like Persistable) and return values as "INSERT", "UPDATE", "DELETE", "NONE"(means non operation must be performent on reference collection element).
Example:

class AgregateRoot implements Persistable{
     .........
     @UpdateStrategy("UPSERT")
     Set<ChileAggregate> aggregate;
}

class ChildAggregate implements SomeInterface{
       .......
      public changeType(){
              return "UPDATE";
      }
}

Issue Links:
#210
DATAJDBC-210

@schauder
Copy link
Contributor

Duplicate of #437

@schauder schauder marked this as a duplicate of #437 Dec 13, 2022
@schauder schauder closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2022
@schauder schauder added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants