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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Member

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

This comment has been minimized.

Member

bartoszwalacik commented Sep 26, 2015

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

@igler

This comment has been minimized.

igler commented Sep 26, 2015

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Sep 26, 2015

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

@igler

This comment has been minimized.

igler commented Sep 28, 2015

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

@bartoszwalacik

This comment has been minimized.

Member

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

This comment has been minimized.

Member

bartoszwalacik commented Sep 30, 2015

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

@igler

This comment has been minimized.

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

This comment has been minimized.

Member

bartoszwalacik commented Oct 11, 2015

looks like a good idea

@igler

This comment has been minimized.

igler commented Nov 10, 2015

See #246

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Nov 11, 2015

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

@bartoszwalacik

This comment has been minimized.

Member

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

Merge pull request #446 from javers/issue-209-get-changes-in-multiple…
…-classes

 #209 quering for changes in multiple classes
@bartoszwalacik

This comment has been minimized.

Member

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