Java Reference
In-Depth Information
<property name="mappingLocations">
<list>
<value>classpath:jbpm.execution.hbm.xml</value>
<value>classpath:jbpm.repository.hbm.xml</value>
<value>classpath:jbpm.task.hbm.xml</value>
<value>classpath:jbpm.history.hbm.xml</value>
</list>
</property>
<property name="annotatedClasses" ref="annotatedHibernateClasses" />
</bean>
<util:list id="annotatedHibernateClasses" />
The next bean—the dataSource —is configured entirely at your discretion. The properties are set
using properties in the properties file jbpm4.properties . The contents of jbpm4.properties :
hibernate.configFile=hibernate.cfg.xml
dataSource.password=sep
dataSource.username=sep
dataSource.databaseName=sep
dataSource.driverClassName=org.postgresql.Driver
dataSource.dialect=org.hibernate.dialect.PostgreSQLDialect
dataSource.serverName=sep
dataSource.url=jdbc:postgresql://${dataSource.serverName}/${dataSource.databaseName}
dataSource.properties=user=${dataSource.username};databaseName=${dataSource.databaseName};se
rverName=${dataSource.serverName};password=${dataSource.password}
Modify the values there to reflect your database of choice. As mentioned before, there are lots of
supported databases. If you're using MySQL, I'd suggest something like the InnoDB table type to take
advantage of transactions. In our experience, PostgreSQL, MySQL, Oracle, and so forth, all work fine.
You'll also want to configure a transaction manager. You will use this later when setting up AOP-advised
transaction management for our beans.
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close" p:driverClassName="${dataSource.driverClassName}"
p:username="${dataSource.username}" p:password="${dataSource.password}"
p:url="${dataSource.url}" />
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager"
p:sessionFactory-ref="sessionFactory" />
Additionally, add a HibernateTemplate , as you'll need it to interact with both your and jBPM's
entities.
<bean id="hibernateTemplate"
class="org.springframework.orm.hibernate3.HibernateTemplate"
p:sessionFactory-ref="sessionFactory" />
Search WWH ::




Custom Search