Hello,
I'm currently doing an app to reserve meals online. I have following domain classes:
Code:class Meal { static hasMany = [mealitems : Mealitem] Date date String title }Code:class Mealitem { int id String text float price String imageUrl }Code:class Orders { User user Meal meal Date created static hasMany = [mealitems : Mealitem] }
I can do orders, that works out perfectly well. But when I want to display all my orders, I need to show the meal and my ordered items.
By:
this shows me my ordered meals BUT all its items - I just want my ordered ones.Code:def user = User.findByEmail("doe@example.org") def orders = Orders.findAllByUser(user) [orders : orders]
How can I do that?
Thank you very much.
Best,
Silavn


Reply With Quote