I have a domain class called Order, and this class is related hasManyto the class Item. When I request a list of orders with certain restrictions, I get as many copies Orderas I have items.
So, for example, an Orderinstance refers to 3 instances Item, then a query for criteria on Orderreturns 3 duplicate instances Order. I'm not sure, but if it's worth mentioning that the domain class Orderhas fetchModeit set to "eager".
I am really puzzled by what is going on there. Any help in this regard will be greatly appreciated. Code snippet added:
def clazz = "cust.Order"
def criteria = clazz.createCriteria()
println("clazz == "+Order.list())
def filter = {
}
List results = criteria.list(max:params?.max,offset:params?.offset,filter)
results.each{Object data->
println(data.getClass())
}
println("results == "+results)
Thanks again