sanghavi7
sanghavi7

Reputation: 754

Grails, domain class default value for Field

I want to update date Field when any row updated. Means whenever I update perticular field the date need to be changed automatically.

How can I got this in grails Domain class??

Upvotes: 1

Views: 878

Answers (1)

David
David

Reputation: 1970

Grails can do that for you!

Go to http://grails.org/doc/latest/guide/GORM.html and search for 'Automatic timestamping'

There are 2 fields supported:
"By defining a lastUpdated and dateCreated property these will be automatically updated for you by GORM."

Upvotes: 4

Related Questions