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

Query for Author #334

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

Query for Author #334

BenPezzei opened this issue Feb 5, 2016 · 4 comments
Assignees
Labels

Comments

@BenPezzei
Copy link

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
Copy link
Member

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
Copy link

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
Copy link
Member

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.

@bartoszwalacik
Copy link
Member

released in 2.0.0-RC

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

No branches or pull requests

4 participants