Skip to content

Latest commit

 

History

History

SpringBatchMultiReaderHibernateWriter

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

SpringBatchMultiReaderHibernateWriter

Runtime Environment

Short & Quick introduction

Create Database Table and populate it with sample data

create table EXAM_RESULT (
   id INT NOT NULL auto_increment PRIMARY KEY,
   student_name VARCHAR(30) NOT NULL,
   dob DATE NOT NULL,
   percentage double NOT NULL
);

Prepare Input files

  • ExamResult-Year2001.txt
  • ExamResult-Year2002.txt
  • ExamResult-Year2003.txt

Create Entity Class

  • com.websystique.springbatch.model.ExamResult

Create Mapper to map the File fields to Entity Class

  • com.websystique.springbatch.ExamResultFieldSetMapper

Create an ItemProcessor

  • com.websystique.springbatch.ExamResultItemProcessor

Add a Job listener(JobExecutionListener)

  • com.websystique.springbatch.ExamResultJobListener

Create Spring Context with Hibernate SessionFactory & Spring Batch job configuration

  • src/main/resource/context-datasource.xml
  • src/main/resource/context-model.xml
  • src/main/resource/spring-batch-context.xml

Create Main application to finally run the job

  • com.websystique.springbatch.Main

Links