|
I've search for an answer on this and I'm not sure it's fixed or not.
The enviroment is : grails-2 (recently migrated - I've already cleaned the project) datasource.groovy development { dataSource { dbCreate = "create-drop" // one of 'create', 'create-drop','update' url = "jdbc:mysql://localhost:3306/hunter_lead" } dataSource_hunter { readOnly=true driverClassName='com.mysql.jdbc.Driver' url='jdbc:mysql://localhost:3306/hunter' username='xxx' password='xxxxx' dbCreate = 'validate' // logSql(true) dialect = 'org.hibernate.dialect.MySQLDialect' } } classes package br.com.adlead abstract class Lead { static constraints = { } static mapping = { tablePerHierarchy false } int status; int numVezes; int numEnvios; Date dateCreated Date lastUpdated Usuario usuario; Regiao estado Regiao cidade Regiao bairro static belongsTo = Usuario } And Regiao, which points to another datasource package br.com.adlead class Regiao { String nome String nomeDisp String sigla boolean active Regiao parent static belongsTo = Regiao boolean isAttributeValue static hasMany = [children:Regiao] static mapping = { datasource 'hunter' version false parent column: 'pid' } String toString(){ def temp = nome if(parent!=null){ temp += ", $parent.nome" } temp } } The solution I've read said it was fixed and should work and the other is to have just the RegiaoId in the Lead Class with the get methods looking up to the full object Regards, |
|
Are both your classes located in "grails-app/domain/br/com/adlead"?
Em 27-02-2012 18:14, eduardoarantes escreveu: > I've search for an answer on this and I'm not sure it's fixed or not. > > The enviroment is : > grails-2 (recently migrated - I've already cleaned the project) > > datasource.groovy > > development { > dataSource { > dbCreate = "create-drop" // one of 'create', > 'create-drop','update' > url = "jdbc:mysql://localhost:3306/hunter_lead" > } > dataSource_hunter { > readOnly=true > driverClassName='com.mysql.jdbc.Driver' > url='jdbc:mysql://localhost:3306/hunter' > username='xxx' > password='xxxxx' > dbCreate = 'validate' > // logSql(true) > dialect = 'org.hibernate.dialect.MySQLDialect' > } > } > > > classes > > package br.com.adlead > > abstract class Lead { > > static constraints = { > } > static mapping = { > tablePerHierarchy false > } > int status; > int numVezes; > int numEnvios; > Date dateCreated > Date lastUpdated > Usuario usuario; > Regiao estado > Regiao cidade > Regiao bairro > > static belongsTo = Usuario > } > > And Regiao, which points to another datasource > > package br.com.adlead > > class Regiao { > > String nome > String nomeDisp > String sigla > boolean active > Regiao parent > static belongsTo = Regiao > > boolean isAttributeValue > > static hasMany = [children:Regiao] > > > static mapping = { > datasource 'hunter' > version false > parent column: 'pid' > } > > String toString(){ > > def temp = nome > if(parent!=null){ > temp += ", $parent.nome" > } > temp > } > } > > > The solution I've read said it was fixed and should work and the other is to > have just the RegiaoId in the Lead Class with the get methods looking up to > the full object > > Regards, > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
Yes, they are. Em 27/02/2012 19:31, "rosenfeld [via Grails]" <[hidden email]> escreveu:
Are both your classes located in "grails-app/domain/br/com/adlead"? |
|
No, I think that is the correct location.
If you could send me a working application attached, I could try to understand what could be happening. Or if you prefer to talk to me in Portuguese, you can add me on Skype or Google Talk if you prefer. Abraço, Rodrigo. Em 27-02-2012 19:42, eduardoarantes escreveu:
|
|
Just for the record, this issue was already solved outside this
list.
I've talked to Eduardo in Skype and the issue is that he was trying to create relationships among classes mapped by different databases, which I doubt it would be supported by most ORM frameworks, including Hibernate (and GORM, consequently). Still, I think the error message could be clearer. Cheers, Rodrigo. Em 28-02-2012 09:37, Rodrigo Rosenfeld Rosas escreveu: No, I think that is the correct location. |
|
Just a quick message about :
Support for such relationship is planned in the upcoming release. The implementation should look like bytecode transforming getter/setter to use GORM queries instead of default behavior. On Tue, Feb 28, 2012 at 4:26 PM, Rodrigo Rosenfeld Rosas <[hidden email]> wrote:
Stéphane MALDINI
-- |
|
Em 28-02-2012 12:33, Stephane Maldini escreveu:
Just a quick message about : Good to know. Thanks for keeping us up to date. :) |
| Powered by Nabble | Edit this page |
