Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can .hbm files be used in a JPA application with Hibernate as JPA provider?

I'd like to replace custom BPM implementation with Activiti or jBPM-5 in a product which uses Hibernate (No JPA) with Spring for persistent layer implementation. Unfortunately, both Activiti and jBPM5 require JPA(according to their documentation) and it is not possible to migrate all existing Hibernate implementation to JPA in the product.

  1. Is there a way to configure JPA 2.0(JPA provider is Hibernate) with Spring 3 without migrating Hibernate implementation to JPA (i.e. retain .hbm files) ?

Note: I'm aware that application will not be compliant with JPA and another JPA provider can not be used.

  1. If there is way, assume Spring JTA transaction manager is configured with proper settings. can application logic and BPM workflow logic be executed in a single Spring transaction?
like image 463
Sujee Avatar asked Feb 10 '11 17:02

Sujee


1 Answers

Regarding transactions see Activiti Spring Transaction Docs. If you cannot port your application to use JPA, another option is to layer a facade over your Hibernate domain. Activiti allows you to invoke methods on spring managed beans, so you could create a facade or utilize an existing service layer. Take a look at the sample applications that ship with Activity to see how the spring integration works.

like image 71
Rich Kroll Avatar answered Oct 06 '22 00:10

Rich Kroll