Quantcast

An association from the table lead refers to an unmapped class: br.com.adlead.Regiao

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

An association from the table lead refers to an unmapped class: br.com.adlead.Regiao

eduardoarantes
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,

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: An association from the table lead refers to an unmapped class: br.com.adlead.Regiao

rosenfeld
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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: An association from the table lead refers to an unmapped class: br.com.adlead.Regiao

eduardoarantes

Yes, they are.
Should they be in a diferent package?

Em 27/02/2012 19:31, "rosenfeld [via Grails]" <[hidden email]> escreveu:
Are both your classes located in "grails-app/domain/br/com/adlead"?

Em <a href="tel:27-02-2012%2018" value="+12702201218" target="_blank">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





To unsubscribe from An association from the table lead refers to an unmapped class: br.com.adlead.Regiao, click here.
NAML
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: An association from the table lead refers to an unmapped class: br.com.adlead.Regiao

rosenfeld
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:

Yes, they are.
Should they be in a diferent package?

Em 27/02/2012 19:31, "rosenfeld [via Grails]" <[hidden email]> escreveu:
Are both your classes located in "grails-app/domain/br/com/adlead"?

Em <a href="tel:27-02-2012%2018" value="+12702201218" target="_blank">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,
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: An association from the table lead refers to an unmapped class: br.com.adlead.Regiao

rosenfeld
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.

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:

Yes, they are.
Should they be in a diferent package?

Em 27/02/2012 19:31, "rosenfeld [via Grails]" <[hidden email]> escreveu:
Are both your classes located in "grails-app/domain/br/com/adlead"?

Em <a href="tel:27-02-2012%2018" value="+12702201218" target="_blank">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,
>



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: An association from the table lead refers to an unmapped class: br.com.adlead.Regiao

smaldini
Just a quick message about :

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).

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.
 
Cheers

On Tue, Feb 28, 2012 at 4:26 PM, Rodrigo Rosenfeld Rosas <[hidden email]> wrote:
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.

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 <a href="tel:27-02-2012%2019" value="+12702201219" target="_blank">27-02-2012 19:42, eduardoarantes escreveu:

Yes, they are.
Should they be in a diferent package?

Em 27/02/2012 19:31, "rosenfeld [via Grails]" <[hidden email]> escreveu:
Are both your classes located in "grails-app/domain/br/com/adlead"?

Em <a href="tel:27-02-2012%2018" value="<a href="tel:%2B12702201218" value="+12702201218" target="_blank">+12702201218" target="_blank"><a href="tel:27-02-2012%2018" value="+12702201218" target="_blank">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,
>






--
Stéphane MALDINI
--


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: An association from the table lead refers to an unmapped class: br.com.adlead.Regiao

rosenfeld
Em 28-02-2012 12:33, Stephane Maldini escreveu:
Just a quick message about :

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).

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.
 
Cheers


Good to know. Thanks for keeping us up to date. :)
Loading...