Efficiently retrieve objects with one to many references in Grails using GORM
- by bebeastie
I'm trying to determine how to find/retrieve/load objects efficiently in terms of a.) minimizing calls to database and b.) keeping the code as elegant/simple as possible (i.e. not writing hql etc.).
Assume you have two objects:
public class Foo {
Bar bar
String badge
}
public class Bar {
String name
}
Each Foo has a bar and a…