本文整理汇总了Java中org.springframework.batch.item.database.JdbcBatchItemWriter.setItemSqlParameterSourceProvider方法的典型用法代码示例。如果您正苦于以下问题:Java JdbcBatchItemWriter.setItemSqlParameterSourceProvider方法的具体用法?Java JdbcBatchItemWriter.setItemSqlParameterSourceProvider怎么用?Java JdbcBatchItemWriter.setItemSqlParameterSourceProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.batch.item.database.JdbcBatchItemWriter
的用法示例。
在下文中一共展示了JdbcBatchItemWriter.setItemSqlParameterSourceProvider方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: customerItemWriter
import org.springframework.batch.item.database.JdbcBatchItemWriter; //导入方法依赖的package包/类
@Bean
@StepScope
public JdbcBatchItemWriter<Customer> customerItemWriter() {
JdbcBatchItemWriter<Customer> itemWriter = new JdbcBatchItemWriter<>();
itemWriter.setDataSource(this.dataSource);
itemWriter.setSql("INSERT INTO NEW_CUSTOMER VALUES (:id, :firstName, :lastName, :birthdate)");
itemWriter.setItemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider());
itemWriter.afterPropertiesSet();
return itemWriter;
}
示例2: jdbcBatchItemWriter
import org.springframework.batch.item.database.JdbcBatchItemWriter; //导入方法依赖的package包/类
@Bean
JdbcBatchItemWriter<Person> jdbcBatchItemWriter(DataSource h2) {
JdbcBatchItemWriter<Person> w = new JdbcBatchItemWriter<>();
w.setDataSource(h2);
w.setSql("insert into PEOPLE( first, last, email) values ( :first, :last, :email )");
w.setItemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider<>());
return w;
}
示例3: jdbcBatchItemWriter
import org.springframework.batch.item.database.JdbcBatchItemWriter; //导入方法依赖的package包/类
@Bean
public JdbcBatchItemWriter<Item> jdbcBatchItemWriter(){
JdbcBatchItemWriter<Item> itemWriter = new JdbcBatchItemWriter<Item>();
itemWriter.setSql("INSERT INTO ITEM (ID, DESCRIPTION) VALUES (:id,:description)");
itemWriter.setDataSource(dataSource);
itemWriter.setItemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider<Item>());
return itemWriter;
}
开发者ID:codecentric,项目名称:spring-boot-starter-batch-web,代码行数:9,代码来源:FlatFileToDbSkipReaderTransactionalJobConfiguration.java
示例4: writer
import org.springframework.batch.item.database.JdbcBatchItemWriter; //导入方法依赖的package包/类
@Bean(name = readCsvFileIntoTableStepWriter)
public JdbcBatchItemWriter<Customer> writer(DataSource dataSource) throws Exception {
JdbcBatchItemWriter<Customer> jdbcBatchItemWriter = new JdbcBatchItemWriter<Customer>();
jdbcBatchItemWriter.setAssertUpdates(true);
jdbcBatchItemWriter.setDataSource(dataSource);
jdbcBatchItemWriter.setSql(" INSERT INTO customer( first_name, last_name) VALUES ( :firstName , :lastName ) ");
jdbcBatchItemWriter.setItemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider<Customer>());
return jdbcBatchItemWriter;
}
示例5: dbWriter
import org.springframework.batch.item.database.JdbcBatchItemWriter; //导入方法依赖的package包/类
@Bean
public ItemWriter<Person> dbWriter() {
JdbcBatchItemWriter<Person> writer = new JdbcBatchItemWriter<>();
writer.setItemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider<Person>());
writer.setSql("INSERT INTO person (login, passwd, age) VALUES (:login,:passwd,:age)");
writer.setDataSource(dataSource);
return writer;
}
示例6: jdbcBatchItemWriter
import org.springframework.batch.item.database.JdbcBatchItemWriter; //导入方法依赖的package包/类
@Bean
public JdbcBatchItemWriter<Item> jdbcBatchItemWriter(){
JdbcBatchItemWriter<Item> itemWriter = new JdbcBatchItemWriter<Item>();
itemWriter.setSql("INSERT INTO ITEM (ID, DESCRIPTION, FIRST_ACTION, SECOND_ACTION) VALUES (:id,:description,:firstAction,:secondAction)");
itemWriter.setDataSource(dataSource);
itemWriter.setItemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider<Item>());
return itemWriter;
}
开发者ID:codecentric,项目名称:spring-boot-starter-batch-web,代码行数:9,代码来源:FlatFileToDbNoSkipJobConfiguration.java