Can somebody explain a way to fetch one to many associations and parent-child type associations using Apache DbUtils? I tried searching but could not find one example for one to many association? Also the documentation on the DbUtils page also does not show an example for this case?
E.g.
class Category {
String code;
List<Product> products;
List<Category> subCategories;
}
Assume I have categories
table having a parent_category
column for the parent-child relationship, products
table and an association table category_products
table with category_code and product_code only. Assume I have my query working and want to fetch category with all subcategories and products at one go. Is this possible with DbUtils? I have many such cases, so is there a generic, neater way or we have to write lots of custom code in each case? Even so, can you show me an example?
Thanks,
Paddy