class JpaJobConfiguration {

	@Bean
	public JpaPagingItemReader<CustomerCredit> itemReader(EntityManagerFactory entityManagerFactory) {
		return new JpaPagingItemReaderBuilder<CustomerCredit>().name("itemReader")
			.entityManagerFactory(entityManagerFactory)
			.queryString("select c from CustomerCredit c")
			.build();
	}

	@Bean
	public JpaItemWriter<CustomerCredit> itemWriter(EntityManagerFactory entityManagerFactory) {
		return new JpaItemWriterBuilder<CustomerCredit>().entityManagerFactory(entityManagerFactory).build();
	}

	@Bean
	public Job job(JobRepository jobRepository, JpaTransactionManager jpaTransactionManager,
			JpaPagingItemReader<CustomerCredit> itemReader, JpaItemWriter<CustomerCredit> itemWriter) {<FILL_FUNCTION_BODY>}

	// Infrastructure beans

	@Bean
	public JpaTransactionManager jpaTransactionManager(EntityManagerFactory entityManagerFactory) {
		return new JpaTransactionManager(entityManagerFactory);
	}

	@Bean
	public EntityManagerFactory entityManagerFactory(PersistenceUnitManager persistenceUnitManager,
			DataSource dataSource) {
		LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
		factoryBean.setDataSource(dataSource);
		factoryBean.setPersistenceUnitManager(persistenceUnitManager);
		factoryBean.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
		factoryBean.afterPropertiesSet();
		return factoryBean.getObject();
	}

	@Bean
	public PersistenceUnitManager persistenceUnitManager(DataSource dataSource) {
		DefaultPersistenceUnitManager persistenceUnitManager = new DefaultPersistenceUnitManager();
		persistenceUnitManager.setDefaultDataSource(dataSource);
		persistenceUnitManager.afterPropertiesSet();
		return persistenceUnitManager;
	}

}

		return new JobBuilder("ioSampleJob", jobRepository)
			.start(new StepBuilder("step1", jobRepository)
				.<CustomerCredit, CustomerCredit>chunk(2, jpaTransactionManager)
				.reader(itemReader)
				.processor(new CustomerCreditIncreaseProcessor())
				.writer(itemWriter)
				.build())
			.build();
	
<no_super_class>