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

QueryBuilder can take abstract class #209

Closed
igler opened this issue Sep 25, 2015 · 14 comments
Closed

QueryBuilder can take abstract class #209

igler opened this issue Sep 25, 2015 · 14 comments
Labels

Comments

@igler
Copy link

@igler igler commented Sep 25, 2015

Currently only non-abstract classes work for the following resolution of changes:

javers.findChanges(QueryBuilder.byClass(NotAnAbstractEntity.class).build());
If I try byClass with an abstract class nothing is returned. It would be nice if all subclasses are queried and changes on all of them are returned.
@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Sep 26, 2015

Agreed that it would be nice, but I cant see obvious way of effective implementation of this query (without running table full scans)...

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Sep 26, 2015

In Java , there is no easy way to find all subclasses af a given class using Reflection API

@igler
Copy link
Author

@igler igler commented Sep 26, 2015

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Sep 26, 2015

Yeah , there are some libs for that but I really want to keep JaVers lightweight.

@igler
Copy link
Author

@igler igler commented Sep 28, 2015

BTW, how can I get all changes of all entities, ideally with Paging support?

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Sep 30, 2015

for now you cant, but it can be easily implemented, also we have a task about paging #179, ideal for contribution

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Sep 30, 2015

let me know if you would like to contribute these two things

@igler
Copy link
Author

@igler igler commented Oct 10, 2015

I think extending

public static QueryBuilder byClass(Class requiredClass)

to

public static QueryBuilder byClass(Class... requiredClasses)

could help so I can submit a list of classes and do reflections on my side?

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Oct 11, 2015

looks like a good idea

@igler
Copy link
Author

@igler igler commented Nov 10, 2015

See #246

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Nov 11, 2015

ok, but there is no implementation and no tests in this PR ...

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Nov 12, 2015

I've seen this method, but this is only a query.
you should write a test for this feature (in JaversRepositoryE2ETest),
second thing, looks like implementation for this Query in QueryRunner is missing

mwesolowski added a commit that referenced this issue Oct 20, 2016
mwesolowski added a commit that referenced this issue Oct 20, 2016
mwesolowski added a commit that referenced this issue Oct 20, 2016
mwesolowski added a commit that referenced this issue Oct 28, 2016
bartoszwalacik added a commit that referenced this issue Oct 30, 2016
…-classes

 #209 quering for changes in multiple classes
@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Oct 30, 2016

fixed in release 2.6.0
see http://javers.org/release-notes/

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
2 participants