开发者

Using an existing GORM data model in standalone Java app

开发者 https://www.devze.com 2023-01-25 07:31 出处:网络
I have an existing Grails app and a separate, existing J开发者_JAVA技巧ava app.I would like the Java app to access the same database schema as the Grails app.Is there a way I can rip out the domain cl

I have an existing Grails app and a separate, existing J开发者_JAVA技巧ava app. I would like the Java app to access the same database schema as the Grails app. Is there a way I can rip out the domain classes and GORM dependencies from the Grails app into a library that the Java app can access?

I'd also be happy to hear alternative approaches that would be less work than rewriting my DAO layer in the Java app.


This isn't supported and may or may not work. See http://www.grails.org/GORM+-+StandAlone+Gorm You could always use pure Hibernate from your Java app and create the Hibernate model by reverse engineering your existing Grails database scghema.


Here's another workaround: http://burtbeckwith.com/blog/?p=72


You could use web services and call into grails service classes from the Java app.

0

精彩评论

暂无评论...
验证码 换一张
取 消