Take the 2-minute tour ×

I am getting a resultset from a query which has users object like this

column summap=[[6, gra.Users : 1], [2, gra.Users: 7]]

where 1,7 are the ids of the user from Users entity

I want to get employeeid from this id how do I do that?

I tried Users.get(it[1]).employeeid but it says cannot get property employeeid on null object.
How do I get employeeid?

Regards Priyank

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

gra.Users : 1 looks like the default toString() output for a domain class, so I'm guessing that the 2nd values in each array are Users instances, not ids. So it'd be something like

def results = executeQuery(...) // [[6, gra.Users : 1], [2, gra.Users: 7]]
def employeeIds = results.collect { it[1].employeeid }
share|improve this answer
thats absolutely right Burt..just tried it before and it worked! :) –  pri_dev Jan 18 '12 at 8:49
add comment


share|improve this answer
This also looks good..thanks.. its just a round about way.. –  pri_dev Jan 18 '12 at 8:53
add comment

Your Answer


