Using Java classes(whole module with Spring/Hibernate dependency) in Grails

Posted by Sitaram on Stack Overflow See other posts from Stack Overflow or by Sitaram
Published on 2011-01-11T10:49:41Z Indexed on 2011/01/11 10:53 UTC
Read the original article Hit count: 217

Filed under:
|
|

I have a Java/Spring/Hibernate application with a payment module. Payment module has some domain classes for payment subscription and transactions etc. Corresponding hibernate mapping files are there. This module uses applicationContext.xml for some of the configuration it needs.

Also, This module has a PaymentService which uses a paymentDAO to do all database related work.

Now, I want to use this module as it is(without any or minimal re-writing) in my other application(Grails application). I want to bring in the payment module as a jar or copy the source files to src/java folder in Grails.

With that background, I have following queries:

Will the existing applicationContext.xml for Spring configuration in the module will work as it is in Grails? Does it merge with rest of Grails's Spring config? Where do I put the applicationContext.xml? classpath? src/java should work? Can I bundle the applicationContext.xml in Jar(If I use jar option) and can overwrite in Grails if anything needs to be changed? Multiple bean definition problems in that case? PaymentService recognized as regular service? Will it be auto-injected in controllers and/or other services? Will PaymentDAO use the datasource configuration of Grails? Where do I put the hbm files of this module? Can I bundle the hbm files in Jar(If I use jar option) and can overwrite in Grails if anything needs to be changed? Which hbms are picked? or, there will be problems with that? Too many questions! :)

All these concerns are actually before trying. I am going to try this in next few days(busy currently). Any help is appreciated.

Thanks. Sitaram Meena

© Stack Overflow or respective owner

Related posts about java

Related posts about grails