0

I am working with grails. I have a class:

class Checkin_checkout {
    Date checkin_date
    Date checkout_date
    String time_duration
    int employee_id
}

I want to retrieve all the rows from database having same value of employee_id. please help.

node_modules
  • 4,790
  • 6
  • 21
  • 37

1 Answers1

0

With Grails you can retrieve all rows from the database and then use groupBy to sort your entries by fields. So:

Checkin_checkout.list().groupBy { it.employee_id }
Anatoly
  • 456
  • 5
  • 13