I have a POJO like this
class foo
{
private String id;
private String attribute;
private Map<String, String> dataMap;
}
And my data model is
Table Item
- INT id
- CHAR attribute
//storing dataMap as key-value pair
Table Data
- INT id
- CHAR key
- CHAR value
Now, I want to combines below 2 queries
1st query:
@Select("select * from Item where attribute=#{attribute}"
public List<Item> getItemList(@Param("attribute") String attribute);
another query to get all the key-value pairs for given id
How to have a single query, which given attribute, fetches list of id and populates nested object (dataMap)
//have gone through @Results, @Result ..