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

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

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

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

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

@bartoszwalacik 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants