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

ValueObject changes would be reported when quering for entity changes #220

Closed
floresek opened this Issue Oct 8, 2015 · 5 comments

Comments

Projects
None yet
3 participants
@floresek

floresek commented Oct 8, 2015

Hi,

In current version when calling:

javers.findChanges(
                QueryBuilder.byValueObjectId(entityId, entityClass, path)
                        .withNewObjectChanges(true)
                        .build());

ValueObject changes are reported in shallow level:

  • VO reference change
  • VO collection changed
    Unfortunately changes done in VO properties are not reported.

If an entity has got many Value Objects (by references, in collections) to get all changes done on the entity VO properties many additional complex logic and queries have to be done, to resolve Value Objects changes (starting from resolving VO properties, via resolving what happen to them, even resolving current size of collections, to query if VO from collection was changed etc.)

Because of Value Objects nature (there are parts of entity) it would be VERY USEFUL to be able to query form VO changes as following:

javers.findChanges(
                QueryBuilder.byValueObjectId(entityId, entityClass, path)
                        .withNewObjectChanges(true)
                        .withValueObjectChanges(true)
                        .build());

Cheers
Mariusz

@floresek floresek changed the title from ValueObject changes could be reported when quering for entity changes to ValueObject changes would be reported when quering for entity changes Oct 8, 2015

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Oct 9, 2015

Maybe API should simply looks like that:

javers.findChanges(
                QueryBuilder.byValueObjectId(entityId, entityClass, "*")
                        .build());

and that would give you changes done on all VO embedded in given entity

@palto

This comment has been minimized.

palto commented Jan 27, 2016

I would seriously like this implemented. I already managed to add javers into my application but had to remove it since I can't use it to generate "last modified" time for a given entity because it has ValueObjects.

@palto

This comment has been minimized.

palto commented Jan 27, 2016

If anyone else was wrestling with the same problem as me, I figured out that you can detect changes when calling javers.commit(author, entity).getChanges().isEmpty(). This however means that you can't use the auto proxying of repositories feature.

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Jan 28, 2016

OK, I'am moving this issue higher in our backlog

@bartoszwalacik bartoszwalacik self-assigned this Jan 28, 2016

bartoszwalacik added a commit that referenced this issue Jul 6, 2016

#220
mongo impl

bartoszwalacik added a commit that referenced this issue Jul 8, 2016

#220
perf tests for mongo aggregate query
@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Jul 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment