AFTERSHOX - Tariq Ahmed on Technology :: Management :: Business
  • About Me
  • Resume
  • Contact
  • Learning List
AFTERSHOX - Tariq Ahmed on Technology :: Management :: Business
About Me
Resume
Contact
Learning List
  • About Me
  • Resume
  • Contact
  • Learning List
Groovy / Grails

Grails’ dateCreated and lastUpdated properties

 

 

I’m in the process of learning Groovy and Grails, and Grails has this neat feature called scaffolding where you just create a domain class like a User and all its properties, and it’s auto-create a full CRUD to be able to create/read/update/and delete.

class User
{
	String userId
 	String password
	Date dateCreated
	Date coolStuff
	Profile profile
}

Which when creating, will generate a form like this:

 

 

 

 

 

 

But I was wondering what’s the deal with dateCreated. Turns out that if you define dateCreated and lastUpdated properties, Grails will automatically take care of storing in the database the record creation date and when it was last updated (which is all facilitated via Grails’ ORM Hibernate wrapper).

 

 

10/17/2011by Tariq Ahmed

Who is this dude?

Tariq Ahmed Howdy! My name is Tariq ("Ta-Rick") Ahmed, and a Director of Software Engineering at New Relic where my time is focused on creating developer experiences through our developer websites, APIs, CLIs, SDKs, and ability to build your own custom apps on the New Relic One platform. I'm most passionate about finding amazing people, growing talent, and building amazing teams in order to accomplish meaningful breakthroughs in technology that ultimately create great user experiences.
Twitter feed is not available at the moment.

Categories

  • Agile (11)
  • Business Intelligence (1)
  • Career (7)
  • ColdFusion (7)
  • Collaboration (1)
  • Featured (5)
  • Flex and AIR (2)
  • Groovy / Grails (6)
  • I.T Systems (1)
  • Innovation (4)
  • Leadership (6)
  • Management (8)
  • Project Management (1)
  • Software Development (1)
  • Startups (2)
  • Technology (7)
  • Uncategorized (2)

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Blogroll

  • LinkedIn
  • Teletrac Navman

"This blog is all about sharing thoughts and experiences in my journey as a technology leader. From the technology itself to the processes, practices, and teams needed to make it happen."

Find more at LinkedIn.