Pregunta

I have an Abstract Domain Class in Grails wich has fields that all the other class will use, so the other class extends of it. This field are audit fields. So I use the automatic timestamp fields: dateCreated and LastUpdated and two other String fields.

So I need the columns to have specific names, and for some reason the column name mapping is not working.

static mapping = {
    createUser column: "AUDI_TCREATE_USER"
    editUser column: "AUDI_TEDIT_USER"
    dateCreated column: "AUDI_DDATE_CREATED"
    lastUpdated column: "AUDI_DDATE_MODIFIED"
    tablePerHierarchy false
}

String createUser
String editUser
Date dateCreated
Date lastUpdated

It doesn't throw me any errors, it just keeps the original column name in the DB for every field.

Thanks beforehand.

¿Fue útil?

Solución

No. You have to define mappings in each domain class, which extends your abstract domain class. I am speaking about grails 1.3.x.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top