I am using spring and hibernate together. In my application context, I have this section:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration
</value>
</property>
The hibernate.cfg.xml only contains a list of classes we want hibernate to manage persistence.
I wonder if I can replace this file totally? Can we simply rely on annotation alone to discover the list of classes that needs ORM?
If it is possible in spring, then how?
With AnnotationSessionFactoryBean
For example