Question

Am currently working on a Grails project, that was previously written in some other language. So we have this DB, whose table and column names, we aren't suppose to change. Now the problem is, the column name used for time-stamping is not date_created or last_updated. So is there a way that i can use grails automatic time-stamping and keep my column name unchanged?

Was it helpful?

Solution

How stupid can i be.. Only thing i had to do was to add the below code to my domain class

    static mapping = {
    dateCreated column: "create_date"
    lastUpdated column: "modified_date"
}

Here "created_date" and "modified_date" where my preferred column names.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top