GORM legacy tables mapping

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

GORM legacy tables mapping

Luxor
Hi,

I have two classes. Each of them has the same string client_id column.  So it is impossible to setup hasOne and belongsTo relations for the classes.
AFAIK, Hibernate supports @JoinColumn. Is it possible to propagate @JoinColumn to GORM mapping. 

If not, can somebody point to GORM class which responsible for GORM - HIBERNATE mapping. I would like to extend it

Thanks in advance, Anton


class Client {
   
String id
   
   
static mapping = {
      id column: 'client_id', type: 'string', generator: 'assigned'
      baseClient
/// some setting from Hibernate @JoinColumn
   
}
   
   
static belongsTo = [baseClient: BaseClient]


}

class BaseClient {
   
String id
   
    static mapping = {
      id column: 'client_id', type: 'string', generator: 'assigned'
      client /// some mapping
   
}
   
   
static hasOne = [client: Client]


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/bed71770-5b6f-4f27-a583-cc0fc033f963%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.