This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Groovy and the fly likes Grails - Exisiting Oracle Table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Grails - Exisiting Oracle Table" Watch "Grails - Exisiting Oracle Table" New topic

Grails - Exisiting Oracle Table

Bill Lee

Joined: Feb 02, 2007
Posts: 20
Grails is very straightforward in creating NEW tables, but I am having trouble mapping to an EXISTING table. One of the problems being that it appends id and version to each table. Maybe I need to add some entries for static mapping??? Thanks.
Peter Johnson

Joined: May 14, 2008
Posts: 5852

You can declare a custom identify for your tables, see the docs at Custom%20Database%20Identity
Then Grails will not attempt to create an id field.

Also you can turn off optimistic locking, which prevents the version field form being created:

These questions made me ask if you have read the Grails docs, and/or if you have purchased a Grails book - there are several good ones on the market.

JBoss In Action
I agree. Here's the link:
subject: Grails - Exisiting Oracle Table
jQuery in Action, 3rd edition