Working with legacy database - a challenge in Groovy
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
One of the most important topics in Groovy and Grails is
"Managing legacy tables for 1:M, M:M relationship and using composite keys (without using separate id field or manipulating Hibernate mapping files)"
We had to struggle with legacy database and Grails and finally came up with some kind of crude solution. This requires a lot of manual intervention and I definitely would not call it a simple CRUD as other Groovy-Grails application. Are there any good pointers to the topic of legacy database?
"Managing legacy tables for 1:M, M:M relationship and using composite keys (without using separate id field or manipulating Hibernate mapping files)"
We had to struggle with legacy database and Grails and finally came up with some kind of crude solution. This requires a lot of manual intervention and I definitely would not call it a simple CRUD as other Groovy-Grails application. Are there any good pointers to the topic of legacy database?
===Vyas Sanzgiri===
My Blog
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
The January and February issues of GroovyMag have articles on the "Legacy database from Hell". There is also a lot of information about this in Grails in Action. I've been very successful doing this type of thing in the past using static mappings.
Grails Consultant
http://dangertree.net
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Can you please share some code? Do you have any examples in your blog?
I do not subscribe to those magazines but I tried other Groovy books including Grails in Action and I am still struggling. Is there a new edition of the book?
I do not subscribe to those magazines but I tried other Groovy books including Grails in Action and I am still struggling. Is there a new edition of the book?
===Vyas Sanzgiri===
My Blog
Matthew Taylor
Rancher
Posts: 110
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Googling "grails legacy database" gave me this very informative article on the first page of results.
Grails Consultant
http://dangertree.net
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi Vyas,
The Grails Web Application Development book does not cover working with legacy databases.
Thanks,
Jon.
The Grails Web Application Development book does not cover working with legacy databases.
Thanks,
Jon.
Jon Dickinson
Accolade Consulting
Grails 1.1 Web Application Development
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Checking this out in the context of Groovy in Action book and the latest version 1.1. We are really struggling to apply groovy and grails out of the box to legacy db. We are researching and doing more work than prob Java. Feel that there is no ROI
===Vyas Sanzgiri===
My Blog
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Your mileage will vary depending on how far your database deviates from the Hibernate norm. The Grails user mailing list a useful resource for answering specific database mapping questions. As for ROI, there is a one-off hit in advance associated with the legacy mapping, but you gain the advantage of the dynamic finders, transactional services, GSPs, and other benefits.
On the legacy mapping front, I don't think the GORM mapping DSL supports every feature of Hibernate, so you may have to map some of your classes using Hibernate XML mapping files. It's not pleasant, but at least you only have to do it once.
Cheers,
Peter
On the legacy mapping front, I don't think the GORM mapping DSL supports every feature of Hibernate, so you may have to map some of your classes using Hibernate XML mapping files. It's not pleasant, but at least you only have to do it once.
Cheers,
Peter
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
"The Definitive Guide to Grails" (2nd edition) by Graeme Rocher and Jeff Brown has a whole chapter on integrating legacy databases and Grails using Hibernate (re-mapping keys and relationships etc).
No more Blub for me, thank you, Vicar.
Peter Ledbrook
author
Posts: 25
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Just to avoid confusion, Grails in Action also has a chapter on legacy database integration
Peter
Peter
posted 16 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
The last 2 posts by Peter and Chris have been awesome. I have been looking out for stuff wrt legacy db. For us it doesnt make sense to change the db structure for Grails but we need something similar. I will go thru the links
You are right Peter, we have been using Hibernate XML mapping files and ROI is still under question
You are right Peter, we have been using Hibernate XML mapping files and ROI is still under question
===Vyas Sanzgiri===
My Blog
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I'd be surprised if people are still struggling with Grails + Legacy Database. This link provides very easy to use sample code and straightforward tricks.
http://denistek.blogspot.com/2009/12/grails-and-legacy-database.html
http://denistek.blogspot.com/2009/12/grails-and-legacy-database.html
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Denis, as I said earlier...you are talking about very simple legacy tables. In any enterprise environment we expect complex primary keys - composite keys, Keys which are not string but complex objects.
Grails - out of the box does not support this nor do the plugins. I have to change lot of code in the controller for the CRUD to work. Don't even talk about the plugins!
Grails - out of the box does not support this nor do the plugins. I have to change lot of code in the controller for the CRUD to work. Don't even talk about the plugins!
===Vyas Sanzgiri===
My Blog
Denis Wang
Ranch Hand
Posts: 81
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Do you mind to share your sample code here?
I run into the same issue and look for a solution now.
I run into the same issue and look for a solution now.
| Create symphonies in seed and soil. For this tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |











