Skip to content

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

Closed as not planned
@Husan

Description

@Husan
  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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions