Ordre juste
Most of the time we don’t care about the hibernate mapping configuration when we deploy an application based on JBPM (a worflow framework from Jboss). But if you want to use the same session factory for JBPM and your custom objects (the JBPM spring module have some helper classes) you have several options for the sessionFactory bean declaration in the spring configuration file :
use two mapping sections : one for the JBPM jar file and one for the directory where the mapping files of custom objects are :
<bean id="sessionFactory"...>
<property name="mappingDirectoryLocations">
<list>
<value>classpath*:**/your/custom/objects/mapping</value>
</list>
</property>
<property name="mappingJarLocations">
<list>
<value>file:**/**jbpm-jpdl.jar**</value>
</list>
</property>
</bean>
or extract the JBPM mapping files (find all .hbm.xml files in the extracted JAR) and add the directory to the mappingDirectoryLocations :
<property name="mappingDirectoryLocations">
<list>
<value>classpath*:**/your/custom/objects/mapping</value>
<value>classpath:/the/directory/JBPM/mapping/files/</value>
</list> </property>
Billet publié dans les rubriques Programmation le