wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Can we create a sessionFactory from a combination of Annotated Classes and Hbm files. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Can we create a sessionFactory from a combination of Annotated Classes and Hbm files." Watch "Can we create a sessionFactory from a combination of Annotated Classes and Hbm files." New topic
Author

Can we create a sessionFactory from a combination of Annotated Classes and Hbm files.

Rahul Babbar
Ranch Hand

Joined: Jun 28, 2008
Posts: 210
Hi All,

Is there a way in which we can create a SessionFactory in hibernate using both Annotated Classes and HBM files.

Thanks

Rahul


Rahul Babbar
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Rahul Babbar wrote:Hi All,

Is there a way in which we can create a SessionFactory in hibernate using both Annotated Classes and HBM files.

Thanks

Rahul


1) Yes, if you are using just Hibernate, then you list the .hbm files and classes that are annotated in your hibernate.cfg.xml
2) If you are using JPA and Hibernate is your implementation, then you but it in your persistence.xml file, and I don't think they will be .hbm, so I assume #1 is what you have
3) If you are integrating it with Spring, then it would be in a <bean> tag for an implement of LocalSessionFactoryBean or JPA's Factory Bean as property values to those Spring FactoryBean classes.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can we create a sessionFactory from a combination of Annotated Classes and Hbm files.
 
Similar Threads
Hibernate static SessionFactory
Multiple config file in hibernate
Table Creation
How to create/re-create database using java class And relevant mapping files
Any plugin for hibernate