diff --git a/spring-batch-samples/src/main/sql/db2.properties b/spring-batch-samples/src/main/sql/db2.properties index 532bd942b..9aecf2661 100644 --- a/spring-batch-samples/src/main/sql/db2.properties +++ b/spring-batch-samples/src/main/sql/db2.properties @@ -1,6 +1,7 @@ platform=db2 # SQL language oddities BIGINT = BIGINT -IDENTITY = +IDENTITY = +BLOB = BLOB # for generating drop statements... SEQUENCE = SEQUENCE diff --git a/spring-batch-samples/src/main/sql/derby.properties b/spring-batch-samples/src/main/sql/derby.properties index 9f34bc337..e880dbcc0 100644 --- a/spring-batch-samples/src/main/sql/derby.properties +++ b/spring-batch-samples/src/main/sql/derby.properties @@ -2,6 +2,7 @@ platform=db2 # SQL language oddities BIGINT = BIGINT IDENTITY = -GENERATED = GENERATED BY DEFAULT AS IDENTITY +GENERATED = GENERATED BY DEFAULT AS IDENTITY +BLOB = BLOB # for generating drop statements... -SEQUENCE = SEQUENCE +SEQUENCE = TABLE diff --git a/spring-batch-samples/src/main/sql/derby.vpp b/spring-batch-samples/src/main/sql/derby.vpp index 3713aa6f5..00645d2a7 100644 --- a/spring-batch-samples/src/main/sql/derby.vpp +++ b/spring-batch-samples/src/main/sql/derby.vpp @@ -1,2 +1,2 @@ -#macro (sequence $name)CREATE SEQUENCE ${name}; +#macro (sequence $name)CREATE TABLE ${name} (ID BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, DUMMY VARCHAR(1)); #end diff --git a/spring-batch-samples/src/main/sql/destroy.sql.vpp b/spring-batch-samples/src/main/sql/destroy.sql.vpp index b2e03ec20..856e6e5b3 100644 --- a/spring-batch-samples/src/main/sql/destroy.sql.vpp +++ b/spring-batch-samples/src/main/sql/destroy.sql.vpp @@ -1,8 +1,10 @@ -- Autogenerated: do not edit this file -DROP TABLE TRADE $!{IFEXISTS}; +DROP ${SEQUENCE} BATCH_STAGING_SEQ $!{IFEXISTS}; DROP ${SEQUENCE} TRADE_SEQ $!{IFEXISTS}; -DROP TABLE CUSTOMER $!{IFEXISTS}; DROP ${SEQUENCE} CUSTOMER_SEQ $!{IFEXISTS}; +DROP TABLE BATCH_STAGING $!{IFEXISTS}; +DROP TABLE TRADE $!{IFEXISTS}; +DROP TABLE CUSTOMER $!{IFEXISTS}; DROP TABLE PLAYERS $!{IFEXISTS}; DROP TABLE GAMES $!{IFEXISTS}; DROP TABLE PLAYER_SUMMARY $!{IFEXISTS}; diff --git a/spring-batch-samples/src/main/sql/hsqldb.properties b/spring-batch-samples/src/main/sql/hsqldb.properties index d72d28999..4a853dc4e 100644 --- a/spring-batch-samples/src/main/sql/hsqldb.properties +++ b/spring-batch-samples/src/main/sql/hsqldb.properties @@ -3,5 +3,6 @@ platform=hsqldb BIGINT = BIGINT IDENTITY = IDENTITY IFEXISTS = IF EXISTS +BLOB = LONGVARBINARY # for generating drop statements... SEQUENCE = TABLE diff --git a/spring-batch-samples/src/main/sql/init.sql.vpp b/spring-batch-samples/src/main/sql/init.sql.vpp index 97c4ddc4a..aa1e6155e 100644 --- a/spring-batch-samples/src/main/sql/init.sql.vpp +++ b/spring-batch-samples/src/main/sql/init.sql.vpp @@ -1,4 +1,16 @@ -- Autogenerated: do not edit this file + +#sequence( "CUSTOMER_SEQ" ) +#sequence( "BATCH_STAGING_SEQ" ) +#sequence( "TRADE_SEQ" ) + +CREATE TABLE BATCH_STAGING ( + ID ${BIGINT} $!{IDENTITY} PRIMARY KEY $!{GENERATED}, + JOB_ID ${BIGINT} NOT NULL, + VALUE ${BLOB} NOT NULL, + PROCESSED CHAR(1) NOT NULL +); + CREATE TABLE TRADE ( ID ${BIGINT} $!{IDENTITY} PRIMARY KEY $!{GENERATED}, VERSION ${BIGINT}, @@ -8,8 +20,6 @@ CREATE TABLE TRADE ( CUSTOMER VARCHAR(45) ); -#sequence( "TRADE_SEQ" ) - CREATE TABLE CUSTOMER ( ID ${BIGINT} $!{IDENTITY} PRIMARY KEY $!{GENERATED}, VERSION ${BIGINT}, @@ -17,8 +27,6 @@ CREATE TABLE CUSTOMER ( CREDIT FLOAT ); -#sequence( "CUSTOMER_SEQ" ) - INSERT INTO customer (id, version, name, credit) VALUES (1, 0, 'customer1', 100000); INSERT INTO customer (id, version, name, credit) VALUES (2, 0, 'customer2', 100000); INSERT INTO customer (id, version, name, credit) VALUES (3, 0, 'customer3', 100000); @@ -35,7 +43,7 @@ CREATE TABLE PLAYERS ( CREATE TABLE GAMES ( PLAYER_ID char(8) not null, - YEAR ${BIGINT} not null, + YEAR_NO ${BIGINT} not null, TEAM char(3) not null, WEEK ${BIGINT} not null, OPPONENT char(3), @@ -53,7 +61,7 @@ CREATE TABLE GAMES ( CREATE TABLE PLAYER_SUMMARY ( ID CHAR(8) NOT NULL, - YEAR ${BIGINT} NOT NULL, + YEAR_NO ${BIGINT} NOT NULL, COMPLETES ${BIGINT} NOT NULL , ATTEMPTS ${BIGINT} NOT NULL , PASSING_YARDS ${BIGINT} NOT NULL , diff --git a/spring-batch-samples/src/main/sql/oracle10g.properties b/spring-batch-samples/src/main/sql/oracle10g.properties index 7f8e634e6..cfe99eeb3 100644 --- a/spring-batch-samples/src/main/sql/oracle10g.properties +++ b/spring-batch-samples/src/main/sql/oracle10g.properties @@ -3,5 +3,6 @@ platform=oracle10g BIGINT = NUMBER(38) IDENTITY = GENERATED = +BLOB = BLOB # for generating drop statements... SEQUENCE = SEQUENCE diff --git a/spring-batch-samples/src/main/sql/postgresql.properties b/spring-batch-samples/src/main/sql/postgresql.properties index c716d74b2..9ddc1bb04 100644 --- a/spring-batch-samples/src/main/sql/postgresql.properties +++ b/spring-batch-samples/src/main/sql/postgresql.properties @@ -3,5 +3,6 @@ platform=postgresql BIGINT = BIGINT IDENTITY = GENERATED = +BLOB = BLOB # for generating drop statements... SEQUENCE = SEQUENCE