Let's say I have a person table. A person can have one to three products and it looks like this.
id person_id product price
1 person1 product3 1
2 person1 product2 2
3 person1 product1 10
4 person2 product1 11
5 person2 product2 14
I should get all products for each person, then process it (do mappings to prices, do some logic) and then I write calculated data to the final table, which contains only two fields (person_id and calculated_value, where person_id is a key)
person_id calculated_value
person1 100
person2 111
person3 93
What is the best way to implement item reader in this case ? (get all products for each person and process it) Is it possible to do it in one query in the item reader or I should do additional query in the item processor for each person ?