Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

  • Advertisements

How to Use Hibernate Annotation & .hbm.xml files at single time on a Same project?

Posted by Pankil Patel on June 11, 2012

Use sessionFactory as org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean in its configuration file instead of org.springframework.orm.hibernate3.LocalSessionFactoryBean

Sample configuration is as below:

<bean id=”sessionFactory”
<property name=”annotatedClasses“>
<property name=”mappingResources“>

<property name=”hibernateProperties”>
<prop key=”hibernate.dialect”>org.hibernate.dialect.MySQLDialect</prop>
<prop key=”hibernate.show_sql”>true</prop>
<prop key=”hibernate.cglib.use_reflection_optimizer”>true</prop>
<prop key=”hibernate.cache.provider_class”>org.hibernate.cache.HashtableCacheProvider</prop>

<property name=”dataSource”>
<ref bean=”dataSource” />



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: