Migration of a legacy hibernate tool that automates prefetching.
I'm testing the changes done with a minimal Hibernate project. As for now I'm working on a version for Hibernate 4.3.10 because a target project uses that version. After that I will continue with 5.x.
Add the Maven project to your .pom-file and the autofetch .jar-file will end up in your Maven-dependencies.
Instead of the normal configuration initialization, do the following:
Configuration cfg = new AutofetchConfiguration().configure();
SessionFactory sf = cfg.buildSessionFactory();
Optionally: Wrap instances of Criteria:
Criteria crit = new AutofetchCriteria(sess.createCriteria(Foo.class));
To migrate the tool to the newest version of Hibernate.
The original documentation is included in the repo.
Make a pull request, I need all the help I can get :)