0

Is there a way to get last and recently updated records from the database?

The records don't have any date information and I don't wan't to change the table structure. The ID also can't be used because these are edited records and not newly added.

Jeromy French
  • 11,812
  • 19
  • 76
  • 129
Jacob
  • 3,580
  • 22
  • 82
  • 146

2 Answers2

2

I prefer to add the field lastUpdateted in Domain classes then use the method beforeUpdate from GORM, and then query using order by lastUpdated with limit.

See also "How do you do a limit query in HQL?"

Community
  • 1
  • 1
Jet Geng
  • 347
  • 1
  • 7
0

clarify question!!! there are a lot of ways to do it:

Community
  • 1
  • 1
Olencha
  • 418
  • 2
  • 11