Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing GORM table name

I'm fighting to get the following mapping working in Grails 1.3.1 and MySQL:

class Login {

    int id
    String email

    static mappings = {
        table 'my_table'
        id column: "Mgr_id"
        version false
    }
}

No matter what I do the queries that are being issued refer to "schema.login" table instead of "schema.my_table". This is very frustrating... Can anyone answer why this might not be working?

like image 683
Matthias Hryniszak Avatar asked Jun 17 '10 22:06

Matthias Hryniszak


1 Answers

Please forgive my blindness... The static is called mapping not mappings... eh. Shame on me...

Block should be

static mapping = {
    table 'my_table'
    id column: "Mgr_id"
    version false
}
like image 191
Matthias Hryniszak Avatar answered Oct 24 '22 07:10

Matthias Hryniszak