|
[
Permlink
| « Hide
]
Dave Syer added a comment - 08/Apr/08 03:42 AM
This is the HibernateCursorItemReader right? Do you mean "if we use HQL with projection"? What happens if you do that (how is it broken)?
My HQL is:
select o.field1, o.field2, count(field1) from PO o and o.field1<> null group by o.field1, o.field2 I want these 3 fields in my ItemWriter So, instead of Object data = cursor.get(0); return data; Can we change to: Object[] datas = cursor.get(); if ( datas.length == 1){ return datas[0]; } return datas; So, in my ItemWriter: public void write(Object data) throws Exception { Object[] results = (Object[])data; String field1 = (String)results[0]; String field2 = (String)results[1]; Integer field3 = (Integer)results[2]; } What do you think? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||