Closed GoogleCodeExporter closed 9 years ago
Yes, you should use the instance of the person and not use the internal parts
of the DBRef like $id.
I don't know if the grails plugin is doing this or if you did it manually.
Original comment by scotthernandez
on 22 May 2012 at 3:44
Thanks for the speedy response. So it should be:
def loadedPerson = Person.get(personId);
field('person').equal(loadedPerson)
Is this correct? And are examples of this documented? I hesitated to even ask
the question because of the ubiquity of the blog example; but I cannot seem to
find this sort of query demonstrated anywhere.
Original comment by andy.da...@koanhealth.com
on 22 May 2012 at 3:49
Following up for posterity.
Yes, the correct way to do this is:
field('person').equal(person);
person can either be a loaded object or a dummy that only has the id filled in.
Original comment by andy.da...@koanhealth.com
on 22 May 2012 at 7:13
And to directly answer you question, this was something that I was doing and
had nothing to do with the Grails plugin.
It just wasn't clear how I went from a person ID to a list of items that
referenced the person ID.
Original comment by andy.da...@koanhealth.com
on 22 May 2012 at 7:34
Original issue reported on code.google.com by
andy.da...@koanhealth.com
on 22 May 2012 at 3:41