Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.2.2.GA
Hibernate Annotations version:
3.3.0.GA
Hi,
I'm currently trying to use Hibernate Core with Hibernate Annotations.
So, I change my session factory creation as below following the documentation in Hibernate Annotations. However, it seems that, the created session factory does not include other configuration that I have in hibernate.cfg.xml. So, I wonder how to include those configuration into this AnnotationConfiguration instance.
sessionFactory = new AnnotationConfiguration()
.addAnnotatedClass(test.Department.class).buildSessionFactory();
Other configuration in my hibernate.cfg.xml that I need to add to AnnotationConfiguration are:
<property name="connection.datasource">java:/comp/env/jdbc/cis</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.pool_size">1</property>
<property name="current_session_context_class">thread</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="show_sql">true</property>
<property name="max_fetch_depth">3</property>
Or please advise if there's a way to include the hibernate.cfg.xml file to the AnnotationConfiguration instance. Feel free to highlight if I misunderstand the setup somewhere.
Great thanks.