I have an EJB-based library that needs to be modified to be compatible with Tomcat application server (i.e. no JaveEE). I browsed a bit on Hibernate and got rather confused.

Apparently, there's the natural Hibernate branch that uses a .cfg file as base which is Java SE compliant and then there's a JPA-based Hibernate branch that conditionally depends on Java EE. One thing I also find annoying is that some interfaces are apparently not supported - CriteriaQuery for instance. 

So I'd imagine, I would have to go the natural Hibernate branch to achieve the goal of ridding myself of Java EE (which is annoying given the differences). OTOH, there's also TomEE available that's Tomcat compliant and presumably let me keep most of my code unchanged

It's be nice if I can get some feedback. Thanks.