Does one necessarily have to make a strict choice between using annotations and hibernate configuration files, or is it possible to use both ways at the same time in the same project?
We have a large project done with Hibernate 3.2.5 and POJOs configured with .hbm.xml
files. The project uses Hibernate SessionManager
Factory and not JTA-based EntityManager
factory.
There are over a hundred POJOs configured that way and the original developer team is reluctant to switch to annotations.
Meanwhile we need to extend the project with more POJOs which we are willing to configure with Hibernate annotations and want to stay with Hibernate - if possible - and not switch to JPA.
Is it possible to use a combination of .hbm.xml
config files for some POJOs and annotations for others at the same time?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…