I have a large non-Java EE, JSF-based web app project. Our system is layered (in the source code sense): there's a data model package, building on that is the DAO package. We are using Hibernate's XML configuration mapping exclusively in the DAO package. We really don't want to muddle the data model with annotations, but aren't wedded to Hibernate specifically (except that the mapping is quite complex).
I'm strongly considering making a move towards Java EE and building our DAO objects as EJBs. But as we're unwilling to discard Hibernate's XML, this leads me to several questions:
- Is it possible to use Hibernate with JPA without JPA annotations on the model?
- If not, is it possible for my EJBs to behave transactionally with Hibernate anyway? I think this is called JTA support, but not sure. I like the idea of getting transactions "for free"; right now we have a custom-coded phase listener I'd like to remove which handles Hibernate transactions.
- Is there a way to migrate from Hibernate's XML mapping configuration to some sort of JPA XML mapping? I don't see a way to do this, but obviously it would be better to reduce our coupling to Hibernate.
Thanks!