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

Query for Author #334

Closed
BenPezzei opened this Issue Feb 5, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@BenPezzei

BenPezzei commented Feb 5, 2016

Hi,

We would really appreciate a possibility to use QueryBuilder (or JqlQuery for that matter) to search for changed objects who were updated/deleted/etc by a certain User (=Author)

After looking @ the code a bit, I guess this new Paramter has to be passed all the way "down" to JaversRepository (unfortunately).

Any ideas/hints if this feature may be available in javers?

tnx & regards

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Feb 6, 2016

It would be easy to implement but only for Snapshot queries.
JaversRepository stores only snapshots. When you are querying for Changes, first, Snapshot query is executed and then Changes are recalculated as differences between Snapshots pairs.

For example:

javers.commit("author1",object);
javers.commit("author2",object);
javers.commit("author2",object);

If you query for Changes done by "author2", two snapshots will be found, and only third change set will be returned (between second and third commit).

@BePe2

This comment has been minimized.

BePe2 commented Mar 28, 2016

Hi,

A list of snapshots would be sufficient for starters. Furthermore the API should be flexible enough to cope with "authorOnly"-Queries. Right now, I don't see a way to query for any changes/snapshots disregarding the entityClass.

Again, any hints if this may be implemented in the near future?

Regarding a pull-request: I may do it myself by modifying the QueryBuilder-class (adding static author-method) and pipe the arguments all through down the way to the repository (similar to commitId-Handling)

tnx & regards

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Mar 29, 2016

Hi @BePe2, we are now in the middle of huge SqlRepository refactoring, so I cant promise you anything,
think about PR. This feature is easy to implement, look at this (merged) PR https://github.com/javers/javers/pull/318/files when commitId filter was added. Author filter can be done in a similar way.

@mwesolowski mwesolowski self-assigned this Apr 25, 2016

mwesolowski added a commit that referenced this issue Apr 27, 2016

mwesolowski added a commit that referenced this issue Apr 27, 2016

@mwesolowski mwesolowski added review and removed in progress labels Apr 27, 2016

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented May 21, 2016

released in 2.0.0-RC

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