Is it possible to embed the hibernate mapping hbm.xml’s to the jar and avoid manual reference in applicationContext.xml like
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>
com/…/domain/Question.hbm.xml
and point it to a jar/etc?
Nhibernate has such an option to point to an assembly, from where it picks ups the hbm’s.
Annotations are not an option
Edit: Edit: My intention is to remove manual reference to hbm’s and point to a generic location from where hibernate can pick it up
<list>
<value>
com/.../Question.hbm.xml
</value>
<value>com/.../Users.hbm.xml</value>
<value>
com/.../Answers.hbm.xml
</value>