类 HibernateCreditDao
- java.lang.Object
- org.springframework.batch.sample.domain.trade.internal.HibernateCreditDao
- 所有已实现的接口:
RepeatListener
,CustomerCreditDao
public class HibernateCreditDao extends java.lang.Object implements CustomerCreditDao, RepeatListener
- 作者:
- Lucas Ward, Dave Syer
构造器概要
构造器 构造器 说明 HibernateCreditDao()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
after(RepeatContext context, RepeatStatus result)
Called by the framework after each item has been processed, unless the item processing results in an exception.void
before(RepeatContext context)
Called by the framework before each batch item.void
close(RepeatContext context)
Called once at the end of a complete batch, after normal or abnormal completion (i.e. even after an exception).java.util.List<java.lang.Throwable>
getErrors()
Public accessor for the errors property.void
onError(RepeatContext context, java.lang.Throwable e)
Called when a repeat callback fails by throwing an exception.void
open(RepeatContext context)
Called once at the start of a complete batch, before any items are processed.void
setFailOnFlush(int failOnFlush)
Public setter for the failOnFlush property.void
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
void
write(java.lang.Object output)
void
writeCredit(CustomerCredit customerCredit)
构造器详细资料
HibernateCreditDao
public HibernateCreditDao()
方法详细资料
setSessionFactory
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
getErrors
public java.util.List<java.lang.Throwable> getErrors()
Public accessor for the errors property.- 返回:
- the errors - a list of Throwable instances
writeCredit
public void writeCredit(CustomerCredit customerCredit)
- 指定者:
writeCredit
在接口中CustomerCreditDao
write
public void write(java.lang.Object output)
setFailOnFlush
public void setFailOnFlush(int failOnFlush)
Public setter for the failOnFlush property.- 参数:
failOnFlush
- the ID of the record you want to fail on flush (for testing)
onError
public void onError(RepeatContext context, java.lang.Throwable e)
从接口复制的说明:RepeatListener
Called when a repeat callback fails by throwing an exception. There will be one call to this method for each exception thrown during a repeat operation (e.g. a chunk).
There is no need to re-throw the exception here - that will be done by the enclosing framework.- 指定者:
onError
在接口中RepeatListener
- 参数:
context
- the current batch contexte
- the error that was encountered in an item callback.
after
public void after(RepeatContext context, RepeatStatus result)
从接口复制的说明:RepeatListener
Called by the framework after each item has been processed, unless the item processing results in an exception. This method is called as soon as the result is known.- 指定者:
after
在接口中RepeatListener
- 参数:
context
- the current batch contextresult
- the result of the callback
before
public void before(RepeatContext context)
从接口复制的说明:RepeatListener
Called by the framework before each batch item. Implementers can halt a batch by setting the complete flag on the context.- 指定者:
before
在接口中RepeatListener
- 参数:
context
- the current batch context.
close
public void close(RepeatContext context)
从接口复制的说明:RepeatListener
Called once at the end of a complete batch, after normal or abnormal completion (i.e. even after an exception). Implementers can use this method to clean up any resources.- 指定者:
close
在接口中RepeatListener
- 参数:
context
- the current batch context.
open
public void open(RepeatContext context)
从接口复制的说明:RepeatListener
Called once at the start of a complete batch, before any items are processed. Implementers can use this method to acquire any resources that might be needed during processing. Implementers can halt the current operation by setting the complete flag on the context. To halt all enclosing batches (the whole job), the would need to use the parent context (recursively).- 指定者:
open
在接口中RepeatListener
- 参数:
context
- the current batch context