def c = Employee.createCriteria()
return c.list {
} as Set;
The above code is returning me all the objects of the table.
But when I am trying to filter it like, I am getting null values :
def c = Employee.createCriteria()
return c.list {
'eq'('id', 604931)
} as Set;
(or)
def c = Employee.createCriteria()
return c.list {
'between'('updatededOn', startDate, endDate)
} as Set;
What I exactly want is to retrieve all the rows from the Employee table where updated_on is between startDate and endDate. startDate and endDate are Date objects.
Thanks
This should do it: