-
May 12th, 2010, 12:37 PM
#1
Itemreader read method while dealing with collections
Hi,
I have created custom item reader by implementing the ItemReader interface.
From the read method i am calling a business method which will return collection of items.
public Product read () {
// calling business method ,returns a list of products.
}
According to the commit-interval , how can we return items from reader to writer.
let say , the list contains 100 products and the commit interval is 10.
So , i need to return bunch of 10 products to the item writer.
How we can achieve this?
Regards,
Siva
-
May 14th, 2010, 03:17 AM
#2
ItemReader<Product> returns a Product (singular) from its read() method. If you can only read them as a collection you can either use ItemReader<Collection<Product>> or you can buffer them inside the reader (and if you do the latter either forget about restartability, or implement ItemStream to count the items and re-position on restart).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules