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

Feature: IdFilter with Date #243

Closed
xeraa opened this Issue Oct 31, 2015 · 2 comments

Comments

Projects
None yet
4 participants
@xeraa

xeraa commented Oct 31, 2015

Goal: Get all changes of a specific object (we have the class name and ID) for a given time range. We could just get all changes and throw away the ones outside our timeframe, but this sounds really inefficient.

First, we wanted to wrap the Javers Diff as discussed in #188. But then I saw that all the relevant information is already included in the database (we're using MongoDB). Would you be interested in a pull request something like the following or is there a better approach?

  • Currently available: javers.findChanges(QueryBuilder.byInstanceId(Object localId, Class entityClass).build());
  • Since query, giving you all the changes for that object since the given date: javers.findChanges(QueryBuilder.byInstanceId(Object localId, Class entityClass, Date since).build());
  • Timeframe query, giving you all the changes for that object within the given timeframe: javers.findChanges(QueryBuilder.byInstanceId(Object localId, Class entityClass, Date from, Date to).build());
@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Nov 1, 2015

Having a timeframe query could be a useful feature. We are open to your Pull Request.
Please use builder convention for query API, so sth like this:
QueryBuilder.byInstanceId(Object localId, Class entityClass).from(Date).to(Date)

Also rememner that this change should be implemented for both MongoRepository and JaversSqlRepository. The best place for integration tests is JaversRepositoryE2ETest as it is run using all JaversRepository implementations.

Let me know if you will need some support in design or coding

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Jan 15, 2016

released just now, in version 1.4.2, see http://javers.org/documentation/jql-examples/#commit-date-filter

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