|
Hello folks,
Having issues with tablePerHierarchy false in Grails 2.0. Specifically grails-2.0.0.RC1. Any thoughts? Yes, my base class is abstract and I've defined: static mapping = { tablePerHierarchy false } In fact, here's my entire base class: abstract class BaseDomain { String guid Date dateCreated Date lastUpdated static constraints = { guid(nullable:true, size:36..72) dateCreated(nullable:true) lastUpdated(nullable:true) } static mapping = { tablePerHierarchy false } transient def beforeInsert = { // Allow the subclass to provide the guid if necessary if(!guid) guid = java.util.UUID.randomUUID().toString() } } I keep seeing a base_domain table in the db. We definitely don't want every query joining to the same table. Using mysql Ver 14.14 Distrib 5.5.14. Any thoughts would be appreciated. Thanks, Daniel |
|
Abstract class behave differently in Grails 2.0
Please take a look at http://grails.org/doc/2.0.0.RC1/guide/gettingStarted.html (Look for Abstract Inheritance Changes) Hope it helps. Regards Gaurav Chauhan On Mon, Nov 7, 2011 at 2:07 AM, Daniel Glauser <[hidden email]> wrote: Hello folks, |
|
Hello Gaurav,
Thanks for the reply, that definitely helps to understand why tablePerHierarchy doesn't work anymore. What I'd like to understand is why this change was made? Although I can put data in one place constraints and beforeInstert {...} closures no longer work when I move the base domain class to the src/groovy folder. Is there some other way I can put this functionality in one place? I have a lot of respect for the folks behind Grails but it sure feels like this change is a big step backwards. Thanks, Daniel |
|
Hi Daniel,
Well i have no idea why it was implemented. I get to know about this while listening the latest podcast and people suggested the same alternative of moving abstract classes from domain to src/groovy. Even i am curious know what benefits does it brings to the table? Regards Gaurav Chauhan On Wed, Nov 9, 2011 at 6:49 AM, Daniel Glauser <[hidden email]> wrote: Hello Gaurav, |
| Powered by Nabble | Edit this page |
