org.springframework.batch.sample.domain.trade.internal
Class HibernateAwareCustomerCreditItemWriter

java.lang.Object
  extended by org.springframework.batch.sample.domain.trade.internal.HibernateAwareCustomerCreditItemWriter
All Implemented Interfaces:
org.springframework.batch.item.ItemWriter<CustomerCredit>, org.springframework.beans.factory.InitializingBean

public class HibernateAwareCustomerCreditItemWriter
extends Object
implements org.springframework.batch.item.ItemWriter<CustomerCredit>, org.springframework.beans.factory.InitializingBean

Delegates writing to a custom DAO and flushes + clears hibernate session to fulfill the ItemWriter contract.

Author:
Robert Kasanicky, Michael Minella

Constructor Summary
HibernateAwareCustomerCreditItemWriter()
           
 
Method Summary
 void afterPropertiesSet()
           
 void setDao(CustomerCreditDao dao)
           
 void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
           
 void write(List<? extends CustomerCredit> items)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateAwareCustomerCreditItemWriter

public HibernateAwareCustomerCreditItemWriter()
Method Detail

write

public void write(List<? extends CustomerCredit> items)
           throws Exception
Specified by:
write in interface org.springframework.batch.item.ItemWriter<CustomerCredit>
Throws:
Exception

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 org.springframework.beans.factory.InitializingBean
Throws:
Exception


Copyright © 2013. All Rights Reserved.