Skip to content

Commit 5e20fc2

Browse files
committed
Fix H2/test issues
1 parent fd6039b commit 5e20fc2

File tree

5 files changed

+65
-67
lines changed

5 files changed

+65
-67
lines changed

hibernate5-jakarta/src/test/resources/classicmodels.sql

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ CREATE TABLE `classicmodels`.`Customer` (
3333
`contactFirstName` varchar(50) NOT NULL,
3434
`phone` varchar(50) NOT NULL,
3535
`addressLine1` varchar(50) NOT NULL,
36-
`addressLine2` varchar(50) DEFAULT NULL,
36+
`addressLine2` varchar(50),
3737
`city` varchar(50) NOT NULL,
38-
`state` varchar(50) DEFAULT NULL,
39-
`postalCode` varchar(15) DEFAULT NULL,
38+
`state` varchar(50),
39+
`postalCode` varchar(15),
4040
`country` varchar(50) NOT NULL,
41-
`salesRepEmployeeNumber` int(11) DEFAULT NULL,
42-
`creditLimit` double DEFAULT NULL,
41+
`salesRepEmployeeNumber` int(11),
42+
`creditLimit` double,
4343
`missingProductCode` varchar(50) NULL,
4444
PRIMARY KEY (`customerNumber`)
45-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
45+
);
4646
INSERT INTO `classicmodels`.`Customer` (`customerNumber`,`customerName`,`contactLastName`,`contactFirstName`,`phone`,`addressLine1`,`addressLine2`,`city`,`state`,`postalCode`,`country`,`salesRepEmployeeNumber`,`creditLimit`) VALUES
4747
(103,'Atelier graphique','Schmitt','Carine ','40.32.2555','54, rue Royale',NULL,'Nantes',NULL,'44000','France',1370,21000),
4848
(112,'Signal Gift Stores','King','Sue','7025551838','8489 Strong St.',NULL,'Las Vegas','NV','83030','USA',1166,71800),
@@ -168,7 +168,7 @@ INSERT INTO `classicmodels`.`Customer` (`customerNumber`,`customerName`,`contact
168168
(496,'Kellys Gift Shop','Snowden','Tony','+64 9 5555500','Arenales 1938 3A',NULL,'Auckland ',NULL,'','New Zealand',1612,110000);
169169
INSERT INTO `classicmodels`.`Customer` (`customerNumber`,`customerName`,`contactLastName`,`contactFirstName`,`phone`,`addressLine1`,`addressLine2`,`city`,`state`,`postalCode`,`country`,`salesRepEmployeeNumber`,`creditLimit`, `missingProductCode`) VALUES
170170
(500,'Customer with valid product','Schmitt','Carine ','40.32.2555','54, rue Royale',NULL,'Nantes',NULL,'44000','France',1370,21000, 'S10_1678'),
171-
(501,'Customer with invalid product','Schmitt','Carine ','40.32.2555','54, rue Royale',NULL,'Nantes',NULL,'44000','France',1370,21000, 'X10_1678'),
171+
(501,'Customer with invalid product','Schmitt','Carine ','40.32.2555','54, rue Royale',NULL,'Nantes',NULL,'44000','France',1370,21000, 'X10_1678');
172172

173173
DROP TABLE IF EXISTS `classicmodels`.`Employee`;
174174
CREATE TABLE `classicmodels`.`Employee` (
@@ -178,10 +178,10 @@ CREATE TABLE `classicmodels`.`Employee` (
178178
`extension` varchar(10) NOT NULL,
179179
`email` varchar(100) NOT NULL,
180180
`officeCode` varchar(50) NOT NULL,
181-
`reportsTo` int(11) DEFAULT NULL,
181+
`reportsTo` int(11),
182182
`jobTitle` varchar(50) NOT NULL,
183183
PRIMARY KEY (`employeeNumber`)
184-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
184+
);
185185
INSERT INTO `classicmodels`.`Employee` (`employeeNumber`,`lastName`,`firstName`,`extension`,`email`,`officeCode`,`reportsTo`,`jobTitle`) VALUES
186186
(1002,'Murphy','Diane','x5800','dmurphy@classicmodelcars.com','1',NULL,'President'),
187187
(1056,'Patterson','Mary','x4611','mpatterso@classicmodelcars.com','1',1002,'VP Sales'),
@@ -213,13 +213,13 @@ CREATE TABLE `classicmodels`.`Office` (
213213
`city` varchar(50) NOT NULL,
214214
`phone` varchar(50) NOT NULL,
215215
`addressLine1` varchar(50) NOT NULL,
216-
`addressLine2` varchar(50) DEFAULT NULL,
217-
`state` varchar(50) DEFAULT NULL,
216+
`addressLine2` varchar(50),
217+
`state` varchar(50),
218218
`country` varchar(50) NOT NULL,
219219
`postalCode` varchar(10) NOT NULL,
220220
`territory` varchar(10) NOT NULL,
221221
PRIMARY KEY (`officeCode`)
222-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
222+
);
223223
INSERT INTO `classicmodels`.`Office` (`officeCode`,`city`,`phone`,`addressLine1`,`addressLine2`,`state`,`country`,`postalCode`,`territory`) VALUES
224224
('1','San Francisco','+1 650 219 4782','100 Market Street','Suite 300','CA','USA','94080','NA'),
225225
('2','Boston','+1 215 837 0825','1550 Court Place','Suite 102','MA','USA','02107','NA'),
@@ -234,12 +234,12 @@ CREATE TABLE `classicmodels`.`Order` (
234234
`orderNumber` int(11) NOT NULL,
235235
`orderDate` datetime NOT NULL,
236236
`requiredDate` datetime NOT NULL,
237-
`shippedDate` datetime DEFAULT NULL,
237+
`shippedDate` datetime,
238238
`status` varchar(15) NOT NULL,
239239
`comments` text,
240240
`customerNumber` int(11) NOT NULL,
241241
PRIMARY KEY (`orderNumber`)
242-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
242+
);
243243
INSERT INTO `classicmodels`.`Order` (`orderNumber`,`orderDate`,`requiredDate`,`shippedDate`,`status`,`comments`,`customerNumber`) VALUES
244244
(10100,'2003-01-06 00:00:00','2003-01-13 00:00:00','2003-01-10 00:00:00','Shipped',NULL,363),
245245
(10101,'2003-01-09 00:00:00','2003-01-18 00:00:00','2003-01-11 00:00:00','Shipped','Check on availability.',128),
@@ -576,7 +576,7 @@ CREATE TABLE `classicmodels`.`OrderDetail` (
576576
`priceEach` double NOT NULL,
577577
`orderLineNumber` smallint(6) NOT NULL,
578578
PRIMARY KEY (`orderNumber`,`productCode`)
579-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
579+
);
580580
INSERT INTO `classicmodels`.`OrderDetail` (`orderNumber`,`productCode`,`quantityOrdered`,`priceEach`,`orderLineNumber`) VALUES
581581
(10100,'S18_1749',30,171.7,3),
582582
(10100,'S18_2248',50,67.8,2),
@@ -3583,7 +3583,7 @@ CREATE TABLE `classicmodels`.`Payment` (
35833583
`paymentDate` datetime NOT NULL,
35843584
`amount` double NOT NULL,
35853585
PRIMARY KEY (`customerNumber`,`checkNumber`)
3586-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3586+
);
35873587
INSERT INTO `classicmodels`.`Payment` (`customerNumber`,`checkNumber`,`paymentDate`,`amount`) VALUES
35883588
(103,'HQ336336','2004-10-19 00:00:00',5307.98),
35893589
(103,'JM555205','2003-06-05 00:00:00',16560.3),
@@ -3870,7 +3870,7 @@ CREATE TABLE `classicmodels`.`Product` (
38703870
`buyPrice` double NOT NULL,
38713871
`MSRP` double NOT NULL,
38723872
PRIMARY KEY (`productCode`)
3873-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3873+
);
38743874
INSERT INTO `classicmodels`.`Product` (`productCode`,`productName`,`productLine`,`productScale`,`productVendor`,`productDescription`,`quantityInStock`,`buyPrice`,`MSRP`) VALUES
38753875
('S10_1678','1969 Harley Davidson Ultimate Chopper','Motorcycles','1:10','Min Lin Diecast','This replica features working kickstand, front suspension, gear-shift lever, footbrake lever, drive chain, wheels and steering. All parts are particularly delicate due to their precise scale and require special care and attention.',7933,48.81,95.7),
38763876
('S10_1949','1952 Alpine Renault 1300','Classic Cars','1:10','Classic Metal Creations','Turnable front wheels; steering function; detailed interior; detailed engine; opening hood; opening trunk; opening doors; and detailed chassis.',7305,98.58,214.3),
@@ -3989,7 +3989,7 @@ CREATE TABLE `classicmodels`.`Contrato` (
39893989
`id` numeric(10) NOT NULL,
39903990
`numero_contrato` varchar(50) NOT NULL,
39913991
PRIMARY KEY (`id`)
3992-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3992+
);
39933993
INSERT INTO `classicmodels`.`Contrato` (`id`,`numero_contrato`) VALUES
39943994
(1, '100001-9');
39953995

@@ -3999,7 +3999,7 @@ CREATE TABLE `classicmodels`.`Parcela` (
39993999
`numero_parcela` numeric(10) NOT NULL,
40004000
`contrato_id` numeric(10) NOT NULL,
40014001
PRIMARY KEY (`id`)
4002-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4002+
);
40034003
INSERT INTO `classicmodels`.`Parcela` (`id`,`numero_parcela`,`contrato_id`) VALUES
40044004
(1, 1, 1);
40054005

@@ -4010,13 +4010,11 @@ CREATE TABLE `classicmodels`.`Liquidacao` (
40104010
`contrato_id` numeric(10) NOT NULL,
40114011
`parcela_id` numeric(10) NULL,
40124012
PRIMARY KEY (`id`)
4013-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4013+
);
40144014
INSERT INTO `classicmodels`.`Liquidacao` (`id`,`valor_total`,`contrato_id`, `parcela_id`) VALUES
40154015
(1, 10000, 1, 1);
40164016

40174017

4018-
4019-
40204018
-- Return to H2 regular mode
40214019
SET MODE REGULAR;
40224020

hibernate5/src/test/resources/classicmodels.sql

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ CREATE TABLE `classicmodels`.`Customer` (
3333
`contactFirstName` varchar(50) NOT NULL,
3434
`phone` varchar(50) NOT NULL,
3535
`addressLine1` varchar(50) NOT NULL,
36-
`addressLine2` varchar(50) DEFAULT NULL,
36+
`addressLine2` varchar(50),
3737
`city` varchar(50) NOT NULL,
38-
`state` varchar(50) DEFAULT NULL,
39-
`postalCode` varchar(15) DEFAULT NULL,
38+
`state` varchar(50),
39+
`postalCode` varchar(15),
4040
`country` varchar(50) NOT NULL,
41-
`salesRepEmployeeNumber` int(11) DEFAULT NULL,
42-
`creditLimit` double DEFAULT NULL,
41+
`salesRepEmployeeNumber` int(11),
42+
`creditLimit` double,
4343
`missingProductCode` varchar(50) NULL,
4444
PRIMARY KEY (`customerNumber`)
45-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
45+
);
4646
INSERT INTO `classicmodels`.`Customer` (`customerNumber`,`customerName`,`contactLastName`,`contactFirstName`,`phone`,`addressLine1`,`addressLine2`,`city`,`state`,`postalCode`,`country`,`salesRepEmployeeNumber`,`creditLimit`) VALUES
4747
(103,'Atelier graphique','Schmitt','Carine ','40.32.2555','54, rue Royale',NULL,'Nantes',NULL,'44000','France',1370,21000),
4848
(112,'Signal Gift Stores','King','Sue','7025551838','8489 Strong St.',NULL,'Las Vegas','NV','83030','USA',1166,71800),
@@ -168,7 +168,7 @@ INSERT INTO `classicmodels`.`Customer` (`customerNumber`,`customerName`,`contact
168168
(496,'Kellys Gift Shop','Snowden','Tony','+64 9 5555500','Arenales 1938 3A',NULL,'Auckland ',NULL,'','New Zealand',1612,110000);
169169
INSERT INTO `classicmodels`.`Customer` (`customerNumber`,`customerName`,`contactLastName`,`contactFirstName`,`phone`,`addressLine1`,`addressLine2`,`city`,`state`,`postalCode`,`country`,`salesRepEmployeeNumber`,`creditLimit`, `missingProductCode`) VALUES
170170
(500,'Customer with valid product','Schmitt','Carine ','40.32.2555','54, rue Royale',NULL,'Nantes',NULL,'44000','France',1370,21000, 'S10_1678'),
171-
(501,'Customer with invalid product','Schmitt','Carine ','40.32.2555','54, rue Royale',NULL,'Nantes',NULL,'44000','France',1370,21000, 'X10_1678'),
171+
(501,'Customer with invalid product','Schmitt','Carine ','40.32.2555','54, rue Royale',NULL,'Nantes',NULL,'44000','France',1370,21000, 'X10_1678');
172172

173173
DROP TABLE IF EXISTS `classicmodels`.`Employee`;
174174
CREATE TABLE `classicmodels`.`Employee` (
@@ -178,10 +178,10 @@ CREATE TABLE `classicmodels`.`Employee` (
178178
`extension` varchar(10) NOT NULL,
179179
`email` varchar(100) NOT NULL,
180180
`officeCode` varchar(50) NOT NULL,
181-
`reportsTo` int(11) DEFAULT NULL,
181+
`reportsTo` int(11),
182182
`jobTitle` varchar(50) NOT NULL,
183183
PRIMARY KEY (`employeeNumber`)
184-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
184+
);
185185
INSERT INTO `classicmodels`.`Employee` (`employeeNumber`,`lastName`,`firstName`,`extension`,`email`,`officeCode`,`reportsTo`,`jobTitle`) VALUES
186186
(1002,'Murphy','Diane','x5800','dmurphy@classicmodelcars.com','1',NULL,'President'),
187187
(1056,'Patterson','Mary','x4611','mpatterso@classicmodelcars.com','1',1002,'VP Sales'),
@@ -213,13 +213,13 @@ CREATE TABLE `classicmodels`.`Office` (
213213
`city` varchar(50) NOT NULL,
214214
`phone` varchar(50) NOT NULL,
215215
`addressLine1` varchar(50) NOT NULL,
216-
`addressLine2` varchar(50) DEFAULT NULL,
217-
`state` varchar(50) DEFAULT NULL,
216+
`addressLine2` varchar(50),
217+
`state` varchar(50),
218218
`country` varchar(50) NOT NULL,
219219
`postalCode` varchar(10) NOT NULL,
220220
`territory` varchar(10) NOT NULL,
221221
PRIMARY KEY (`officeCode`)
222-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
222+
);
223223
INSERT INTO `classicmodels`.`Office` (`officeCode`,`city`,`phone`,`addressLine1`,`addressLine2`,`state`,`country`,`postalCode`,`territory`) VALUES
224224
('1','San Francisco','+1 650 219 4782','100 Market Street','Suite 300','CA','USA','94080','NA'),
225225
('2','Boston','+1 215 837 0825','1550 Court Place','Suite 102','MA','USA','02107','NA'),
@@ -234,12 +234,12 @@ CREATE TABLE `classicmodels`.`Order` (
234234
`orderNumber` int(11) NOT NULL,
235235
`orderDate` datetime NOT NULL,
236236
`requiredDate` datetime NOT NULL,
237-
`shippedDate` datetime DEFAULT NULL,
237+
`shippedDate` datetime,
238238
`status` varchar(15) NOT NULL,
239239
`comments` text,
240240
`customerNumber` int(11) NOT NULL,
241241
PRIMARY KEY (`orderNumber`)
242-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
242+
);
243243
INSERT INTO `classicmodels`.`Order` (`orderNumber`,`orderDate`,`requiredDate`,`shippedDate`,`status`,`comments`,`customerNumber`) VALUES
244244
(10100,'2003-01-06 00:00:00','2003-01-13 00:00:00','2003-01-10 00:00:00','Shipped',NULL,363),
245245
(10101,'2003-01-09 00:00:00','2003-01-18 00:00:00','2003-01-11 00:00:00','Shipped','Check on availability.',128),
@@ -576,7 +576,7 @@ CREATE TABLE `classicmodels`.`OrderDetail` (
576576
`priceEach` double NOT NULL,
577577
`orderLineNumber` smallint(6) NOT NULL,
578578
PRIMARY KEY (`orderNumber`,`productCode`)
579-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
579+
);
580580
INSERT INTO `classicmodels`.`OrderDetail` (`orderNumber`,`productCode`,`quantityOrdered`,`priceEach`,`orderLineNumber`) VALUES
581581
(10100,'S18_1749',30,171.7,3),
582582
(10100,'S18_2248',50,67.8,2),
@@ -3583,7 +3583,7 @@ CREATE TABLE `classicmodels`.`Payment` (
35833583
`paymentDate` datetime NOT NULL,
35843584
`amount` double NOT NULL,
35853585
PRIMARY KEY (`customerNumber`,`checkNumber`)
3586-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3586+
);
35873587
INSERT INTO `classicmodels`.`Payment` (`customerNumber`,`checkNumber`,`paymentDate`,`amount`) VALUES
35883588
(103,'HQ336336','2004-10-19 00:00:00',5307.98),
35893589
(103,'JM555205','2003-06-05 00:00:00',16560.3),
@@ -3870,7 +3870,7 @@ CREATE TABLE `classicmodels`.`Product` (
38703870
`buyPrice` double NOT NULL,
38713871
`MSRP` double NOT NULL,
38723872
PRIMARY KEY (`productCode`)
3873-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3873+
);
38743874
INSERT INTO `classicmodels`.`Product` (`productCode`,`productName`,`productLine`,`productScale`,`productVendor`,`productDescription`,`quantityInStock`,`buyPrice`,`MSRP`) VALUES
38753875
('S10_1678','1969 Harley Davidson Ultimate Chopper','Motorcycles','1:10','Min Lin Diecast','This replica features working kickstand, front suspension, gear-shift lever, footbrake lever, drive chain, wheels and steering. All parts are particularly delicate due to their precise scale and require special care and attention.',7933,48.81,95.7),
38763876
('S10_1949','1952 Alpine Renault 1300','Classic Cars','1:10','Classic Metal Creations','Turnable front wheels; steering function; detailed interior; detailed engine; opening hood; opening trunk; opening doors; and detailed chassis.',7305,98.58,214.3),
@@ -3989,7 +3989,7 @@ CREATE TABLE `classicmodels`.`Contrato` (
39893989
`id` numeric(10) NOT NULL,
39903990
`numero_contrato` varchar(50) NOT NULL,
39913991
PRIMARY KEY (`id`)
3992-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3992+
);
39933993
INSERT INTO `classicmodels`.`Contrato` (`id`,`numero_contrato`) VALUES
39943994
(1, '100001-9');
39953995

@@ -3999,7 +3999,7 @@ CREATE TABLE `classicmodels`.`Parcela` (
39993999
`numero_parcela` numeric(10) NOT NULL,
40004000
`contrato_id` numeric(10) NOT NULL,
40014001
PRIMARY KEY (`id`)
4002-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4002+
);
40034003
INSERT INTO `classicmodels`.`Parcela` (`id`,`numero_parcela`,`contrato_id`) VALUES
40044004
(1, 1, 1);
40054005

@@ -4010,13 +4010,11 @@ CREATE TABLE `classicmodels`.`Liquidacao` (
40104010
`contrato_id` numeric(10) NOT NULL,
40114011
`parcela_id` numeric(10) NULL,
40124012
PRIMARY KEY (`id`)
4013-
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4013+
);
40144014
INSERT INTO `classicmodels`.`Liquidacao` (`id`,`valor_total`,`contrato_id`, `parcela_id`) VALUES
40154015
(1, 10000, 1, 1);
40164016

40174017

4018-
4019-
40204018
-- Return to H2 regular mode
40214019
SET MODE REGULAR;
40224020

0 commit comments

Comments
 (0)