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

How to get nested ValuObjects changes #216

Closed
floresek opened this issue Oct 1, 2015 · 5 comments
Closed

How to get nested ValuObjects changes #216

floresek opened this issue Oct 1, 2015 · 5 comments
Labels

Comments

@floresek
Copy link

@floresek floresek commented Oct 1, 2015

Hi,

I have classes:

class Master {
    @Id
    String id;

    Detail detail;

    public Master(String id) {
        this.id = id;
    }
}

@ValueObject
class Detail {
    String data;
    Detail subdetail;

    public Detail(String data) {
        this.data = data;
    }
}

and test code:

        Master master = new Master("1");
        master.detail = new Detail("detail-1");
        master.detail.subdetail = new Detail("subdetail-1.1");
        master.detail.subdetail.subdetail = new Detail("subdetail-1.1.1");
        javers.commit("anonymous", master);

I know how to read first level ValueObject changes:

        List<Change> changes = javers
                .findChanges(QueryBuilder.byValueObjectId("1", Master.class, "detail")
                        .withNewObjectChanges(true)
                        .build());

but how to read second, third, ... - any level VO changes/snapshots?

f.e.

        List<Change> changes = javers
                .findChanges(QueryBuilder.byValueObjectId("1", Master.class, "detail/subdetail")
                        .withNewObjectChanges(true)
                        .build());
@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Oct 1, 2015

well, nested ValueObjects dont have a goood support yet :(

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Feb 12, 2016

related to #220

bartoszwalacik added a commit that referenced this issue Apr 13, 2016
basic support for querying nested VO changes
@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Apr 13, 2016

example query

      def changes = javers.findChanges(QueryBuilder.byValueObjectId(1, DummyUserDetails,
              "dummyAddress/networkAddress").build())
@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Apr 13, 2016

fixes merged to master, waiting for release

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Apr 14, 2016

released in 1.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants