org.springframework.batch.sample.domain.trade.internal
Class HibernateAwareCustomerCreditItemWriter
java.lang.Object
org.springframework.batch.sample.domain.trade.internal.HibernateAwareCustomerCreditItemWriter
- All Implemented Interfaces:
- ItemWriter<CustomerCredit>, InitializingBean
public class HibernateAwareCustomerCreditItemWriter
- extends Object
- implements ItemWriter<CustomerCredit>, InitializingBean
Delegates writing to a custom DAO and flushes + clears hibernate session to
fulfill the ItemWriter contract.
- Author:
- Robert Kasanicky
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HibernateAwareCustomerCreditItemWriter
public HibernateAwareCustomerCreditItemWriter()
write
public void write(List<? extends CustomerCredit> items)
throws Exception
- Description copied from interface:
ItemWriter
- Process the supplied data element. Will not be called with any null items
in normal operation.
- Specified by:
write in interface ItemWriter<CustomerCredit>
- Throws:
Exception - if there are errors. The framework will catch the
exception and convert or rethrow it as appropriate.
setDao
public void setDao(CustomerCreditDao dao)
setSessionFactory
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Specified by:
afterPropertiesSet in interface InitializingBean
- Throws:
Exception
Copyright © 2011 SpringSource. All Rights Reserved.