diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-h2.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-h2.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-h2.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-h2.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-hsqldb.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-hsqldb.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-hsqldb.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-hsqldb.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-insert-only.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-insert-only.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-insert-only.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-insert-only.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-mysql.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-mysql.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-mysql.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-mysql.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-oracle10g.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-oracle10g.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-oracle10g.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-oracle10g.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-postgresql.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-postgresql.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-postgresql.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-postgresql.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-sqlf.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sqlf.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-sqlf.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sqlf.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-sqlserver.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sqlserver.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-sqlserver.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sqlserver.sql diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-sybase.sql b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sybase.sql similarity index 100% rename from spring-batch-core/src/main/resources/org/springframework/batch/core/2.1-to-2.2-migration/migration-sybase.sql rename to spring-batch-core/src/main/resources/org/springframework/batch/core/migration/migration-sybase.sql diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/GemfireItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/GemfireItemWriter.java index 0c8b64a91..8d2868b72 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/GemfireItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/GemfireItemWriter.java @@ -12,19 +12,21 @@ */ package org.springframework.batch.item.data; +import org.springframework.batch.item.ItemWriter; import org.springframework.batch.item.KeyValueItemWriter; +import org.springframework.data.gemfire.GemfireOperations; import org.springframework.data.gemfire.GemfireTemplate; import org.springframework.util.Assert; /** - * An {@ link ItemWriter} that stores items in GemFire + * An {@link ItemWriter} that stores items in GemFire * * @author David Turanski * @since 2.2 * */ public class GemfireItemWriter extends KeyValueItemWriter { - private GemfireTemplate gemfireTemplate; + private GemfireOperations gemfireTemplate; /** * @param gemfireTemplate the {@link GemfireTemplate} to set */ diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java index 6d7f8ec6e..eec6be17d 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/Neo4jItemReader.java @@ -201,7 +201,6 @@ InitializingBean { query.append(" LIMIT " + pageSize); String resultingQuery = query.toString(); - System.out.println("resulting query = " + resultingQuery); if (logger.isDebugEnabled()) { logger.debug(resultingQuery); diff --git a/src/site/apt/getting-started.apt b/src/site/apt/getting-started.apt index dc2a8269d..0120efbda 100644 --- a/src/site/apt/getting-started.apt +++ b/src/site/apt/getting-started.apt @@ -83,3 +83,8 @@ $ mvn test * There is a Groovy project template with instructions available {{{http://robokaso.github.com/Groovy-Spring-Batch-Template/}here}} +* Migrating to 2.2.x + + As part of the update to support non-identifying job parameters ({{{https://jira.springsource.org/browse/BATCH-1412}BATCH-1412}}), the database schema for the job repository was updated. To migrate your existing job repository to the new one, you'll need to execute the appropriate migration script for your platform. This script will create the new BATCH_JOB_EXECUTION table and migrate the parameters from the old table to the new table. The script can be found in the <<>> package. + + diff --git a/src/site/docbook/reference/appendix.xml b/src/site/docbook/reference/appendix.xml index 13a73dd09..41bdf3cbe 100644 --- a/src/site/docbook/reference/appendix.xml +++ b/src/site/docbook/reference/appendix.xml @@ -31,20 +31,6 @@ an ItemReader. - - ListItemReader - - Provides the items from a list, one at a - time - - - - ItemReaderAdapter - - Adapts any class to the - ItemReader interface. - - AggregateItemReader @@ -58,6 +44,14 @@ role="bold">END_RECORD + + AmqpItemReader + + Given a Spring AmqpTemplate it provides + synchronous receive methods. The receiveAndConvert() method + lets you receive POJO objects. + + FlatFileItemReader @@ -66,20 +60,6 @@ File - - StaxEventItemReader - - Reads via StAX. See HOWTO - Read from a - File - - - - JdbcCursorItemReader - - Reads from a database cursor via JDBC. See - HOWTO - Read from a Database - - HibernateCursorItemReader @@ -87,6 +67,12 @@ section on Reading from a Database + + HibernatePagingItemReader + + Reads from a paginated HQL query + + IbatisPagingItemReader @@ -95,6 +81,28 @@ running out of memory. See HOWTO - Read from a Database + + ItemReaderAdapter + + Adapts any class to the + ItemReader interface. + + + + JdbcCursorItemReader + + Reads from a database cursor via JDBC. See + HOWTO - Read from a Database + + + + JdbcPagingItemReader + + Given a SQL statement, pages through the rows, + such that large datasets can be read without running out of + memory + + JmsItemReader @@ -103,13 +111,6 @@ received through the injected JmsOperations receive() method - - AmqpItemReader - - Given a Spring AmqpTemplate it provides - synchronous receive methods. The receiveAndConvert() method - lets you receive POJO objects. - JpaPagingItemReader @@ -120,11 +121,48 @@ - JdbcPagingItemReader + ListItemReader - Given a SQL statement, pages through the rows, - such that large datasets can be read without running out of - memory + Provides the items from a list, one at a + time + + + + MongoItemReader + + Given a MongoOperations object and JSON based MongoDB + query, proides items received from the MongoOperations find method + + + + Neo4jItemReader + + Given a Neo4jOperations object and the components of a + Cyhper query, items are returned as the result of the Neo4jOperations.query + method + + + + RepositoryItemReader + + Given a Spring Data PagingAndSortingRepository object, + a Sort and the name of method to execute, returns items provided by the + Spring Data repository implementation + + + + StoredProcedureItemReader + + Reads from a database cursor resulting from the + execution of a database stored procedure. See HOWTO - Read from a + Database + + + + StaxEventItemReader + + Reads via StAX. See HOWTO - Read from a + File @@ -156,6 +194,14 @@ ItemStream and ItemWriter interfaces. + + + AmqpItemWriter + + Given a Spring AmqpTemplate it provides + for synchronous send method. The convertAndSend(Object) + method lets you send POJO objects. + CompositeItemWriter @@ -165,30 +211,21 @@ role="bold">ItemWriter objects - - ItemWriterAdapter - - Adapts any class to the - ItemWriter interface. - - - - PropertyExtractingDelegatingItemWriter - - Extends AbstractMethodInvokingDelegator - creating arguments on the fly. Arguments are created by retrieving - the values from the fields in the item to be processed (via a - SpringBeanWrapper) based on an injected array of field - name - - FlatFileItemWriter Writes to a flat file. Includes ItemStream and Skippable functionality. See section on Writing to a File + + + GemfireItemWriter + Using a GemfireOperations object, items wre either written + or removed from the Gemfire instance based on the configuration of the delete + flag + + HibernateItemWriter @@ -198,6 +235,20 @@ to another item writer to do the actual writing. + + IbatisBatchItemWriter + + Writes items in a batch using the SqlMapClientTemplate + execute() method + + + + ItemWriterAdapter + + Adapts any class to the + ItemWriter interface. + + JdbcBatchItemWriter @@ -207,6 +258,13 @@ flush. + + JmsItemWriter + + Using a JmsOperations object, items are written + to the default queue via the JmsOperations.convertAndSend() method + + JpaItemWriter @@ -216,6 +274,46 @@ then delegates to another writer to do the actual writing. + + MimeMessageItemWriter + + Using Spring's JavaMailSender, items of type MimeMessage + are sent as mail messages + + + + MongoItemWriter + + Given a MongoOperations object, items are written + via the MongoOperations.save(Object) method. The actual write is delayed + until the last possible moment before the transaction commits. + + + + Neo4jItemWriter + + Given a Neo4jOperations object, items are persisted via the + save(Object) method or deleted via the delete(Object) per the + ItemWriter's configuration + + + + PropertyExtractingDelegatingItemWriter + + Extends AbstractMethodInvokingDelegator + creating arguments on the fly. Arguments are created by retrieving + the values from the fields in the item to be processed (via a + SpringBeanWrapper) based on an injected array of field + name + + + + RepositoryItemWriter + + Given a Spring Data CrudRepository implementation, + items are saved via the method specified in the configuration. + + StaxEventItemWriter @@ -224,14 +322,6 @@ convert each item to XML and then writes it to an XML file using StAX. - - AmqpItemWriter - - Given a Spring AmqpTemplate it provides - for synchronous send method. The convertAndSend(Object) - method lets you send POJO objects. - - diff --git a/src/site/docbook/reference/images/meta-data-erd.png b/src/site/docbook/reference/images/meta-data-erd.png index 31771519e..ff099a67c 100755 Binary files a/src/site/docbook/reference/images/meta-data-erd.png and b/src/site/docbook/reference/images/meta-data-erd.png differ diff --git a/src/site/docbook/reference/schema-appendix.xml b/src/site/docbook/reference/schema-appendix.xml index 4e0b0e736..36354f5e7 100644 --- a/src/site/docbook/reference/schema-appendix.xml +++ b/src/site/docbook/reference/schema-appendix.xml @@ -12,7 +12,7 @@ JobInstance, JobExecution, JobParameters, and StepExecution map to BATCH_JOB_INSTANCE, - BATCH_JOB_EXECUTION, BATCH_JOB_PARAMS, and BATCH_STEP_EXECUTION, + BATCH_JOB_EXECUTION, BATCH_JOB_EXECUTION_PARAMS, and BATCH_STEP_EXECUTION, respectively. ExecutionContext maps to both BATCH_JOB_EXECUTION_CONTEXT and BATCH_STEP_EXECUTION_CONTEXT. The JobRepository is responsible for saving and storing @@ -84,7 +84,7 @@ CREATE SEQUENCE BATCH_JOB_EXECUTION_SEQ; CREATE SEQUENCE BATCH_JOB_SEQ; Many database vendors don't support sequences. In these cases, - work-arounds are used, such as the following for mySQL: + work-arounds are used, such as the following for MySQL: CREATE TABLE BATCH_STEP_EXECUTION_SEQ (ID BIGINT NOT NULL) type=MYISAM; INSERT INTO BATCH_STEP_EXECUTION_SEQ values(0); @@ -147,36 +147,37 @@ INSERT INTO BATCH_JOB_SEQ values(0);
- BATCH_JOB_PARAMS + BATCH_JOB_EXECUTION_PARAMS - The BATCH_JOB_PARAMS table holds all information relevant to the + The BATCH_JOB_EXECUTION_PARAMS table holds all information relevant to the JobParameters object. It contains 0 or more - key/value pairs that together uniquely identify a - JobInstance and serve as a record of the parameters - a job was run with. It should be noted that the table has been + key/value pairs passed to a Job and serve as a record of the parameters + a job was run with. For each parameter that contributes to the generation of a job's identity, + the IDENTIFYING flag is set to true. It should be noted that the table has been denormalized. Rather than creating a separate table for each type, there is one table with a column indicating the type: - CREATE TABLE BATCH_JOB_PARAMS ( - JOB_INSTANCE_ID BIGINT NOT NULL , - TYPE_CD VARCHAR(6) NOT NULL , - KEY_NAME VARCHAR(100) NOT NULL , - STRING_VAL VARCHAR(250) , - DATE_VAL TIMESTAMP DEFAULT NULL, - LONG_VAL BIGINT , - DOUBLE_VAL DOUBLE PRECISION, - constraint JOB_INSTANCE_PARAMS_FK foreign key (JOB_INSTANCE_ID) - references BATCH_JOB_INSTANCE(JOB_INSTANCE_ID) + CREATE TABLE BATCH_JOB_EXECUTION_PARAMS ( + JOB_EXECUTION_ID BIGINT NOT NULL , + TYPE_CD VARCHAR(6) NOT NULL , + KEY_NAME VARCHAR(100) NOT NULL , + STRING_VAL VARCHAR(250) , + DATE_VAL DATETIME DEFAULT NULL , + LONG_VAL BIGINT , + DOUBLE_VAL DOUBLE PRECISION , + IDENTIFYING CHAR(1) NOT NULL , + constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID) + references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID) ); Below are descriptions for each column: - JOB_INSTANCE_ID: Foreign Key from the BATCH_JOB_INSTANCE table - that indicates the job instance the parameter entry belongs to. It + JOB_EXECUTION_ID: Foreign Key from the BATCH_JOB_EXECUTION table + that indicates the job execution the parameter entry belongs to. It should be noted that multiple rows (i.e key/value pairs) may exist for - each instance. + each execution. @@ -204,6 +205,10 @@ INSERT INTO BATCH_JOB_SEQ values(0); DOUBLE_VAL: Parameter value, if the type is double. + + + IDENTIFYING: Flag indicating if the parameter contributed to the identity of the related JobInstance. + It is worth noting that there is no primary key for this table. This