Skip to content

Commit eb95246

Browse files
author
Tomáš Kraus
committed
Java SE examples verified.
Signed-off-by: Tomáš Kraus <[email protected]>
1 parent c94ba53 commit eb95246

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
ALTER TABLE PET DROP CONSTRAINT FK_PET_BREED_ID
2-
ALTER TABLE PET DROP CONSTRAINT FK_PET_OWNER_ID
3-
41
DROP TABLE IF EXISTS PET
52
DROP TABLE IF EXISTS BREED
63
DROP TABLE IF EXISTS OWNER

apps/data/se-declarative/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Helidon Data SE Declarative Example
22
----
33

4-
This example demonstrates a Java SE declarative application that utilizes Helidon Data, WebServer,
5-
and a MySQL database.
4+
This example demonstrates a Java SE declarative application that utilizes Helidon Data, EclipseLink,
5+
WebServer, UCP DataSource and Oracle database.
66

77
There are 3 repository interfaces in the example:
88

@@ -16,8 +16,8 @@ annotation. There is no specific limitation on the names of those methods.
1616
All methods in `BreedRepository` and `PetRepository` are defined as methods with queries defined
1717
by the method name. Method names must follow the _Query by Method Name_ grammar.
1818

19-
> **NOTE:** Database tables are initialized with ID auto increment to supply primary key values
20-
> by the database.
19+
> **NOTE:** Database tables are initialized with ID as `NOT NULL PRIMARY KEY`. Primary key values
20+
> are supplied by sequence generator.
2121
2222
## Start the Database
2323

apps/data/se-imperative/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Helidon Data SE Imperative Example
22
----
33

4-
This example demonstrates a Java SE imperative application that utilizes Helidon Data, WebServer,
5-
and a MySQL database.
4+
This example demonstrates a Java SE imperative application that utilizes Helidon Data, EclipseLink,
5+
WebServer and a MySQL database.
66

77
There are 3 repository interfaces in the example:
88

apps/data/se-imperative/src/main/resources/application.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ data:
2323
url: "jdbc:mysql://localhost:3306/pets"
2424
jdbc-driver-class-name: "com.mysql.cj.jdbc.Driver"
2525
init-script: "init.sql"
26-
# EclipseLink properties
26+
drop-script: "drop.sql"
2727
properties:
2828
eclipselink.target-database: "MySQL"
2929
eclipselink.target-server: "None"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DROP TABLE IF EXISTS PET
2+
DROP TABLE IF EXISTS BREED
3+
DROP TABLE IF EXISTS OWNER

apps/data/se-imperative/src/main/resources/init.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
CREATE TABLE OWNER (ID INTEGER NOT NULL, NAME VARCHAR(255) UNIQUE NOT NULL, PRIMARY KEY (ID))
22
CREATE TABLE BREED (ID INTEGER NOT NULL, NAME VARCHAR(255) UNIQUE NOT NULL, PRIMARY KEY (ID))
3-
CREATE TABLE PET (id INTEGER NOT NULL, birth DATE, name VARCHAR(255) UNIQUE NOT NULL, weight DOUBLE(4,2), breed_id INTEGER NOT NULL, owner_id INTEGER NOT NULL, PRIMARY KEY (id))
3+
CREATE TABLE PET (ID INTEGER NOT NULL, BIRTH DATE, NAME VARCHAR(255) UNIQUE NOT NULL, WEIGHT DOUBLE(4,2), BREED_ID INTEGER NOT NULL, OWNER_ID INTEGER NOT NULL, PRIMARY KEY (ID))
44

55
ALTER TABLE OWNER MODIFY COLUMN ID INTEGER NOT NULL AUTO_INCREMENT
66
ALTER TABLE BREED MODIFY COLUMN ID INTEGER NOT NULL AUTO_INCREMENT
77
ALTER TABLE PET MODIFY COLUMN ID INTEGER NOT NULL AUTO_INCREMENT
8-
ALTER TABLE PET ADD CONSTRAINT FK_PET_owner_id FOREIGN KEY (owner_id) REFERENCES OWNER (ID)
9-
ALTER TABLE PET ADD CONSTRAINT FK_PET_breed_id FOREIGN KEY (breed_id) REFERENCES BREED (ID)
8+
ALTER TABLE PET ADD CONSTRAINT FK_PET_OWNER_ID FOREIGN KEY (OWNER_ID) REFERENCES OWNER (ID)
9+
ALTER TABLE PET ADD CONSTRAINT FK_PET_BREED_ID FOREIGN KEY (BREED_ID) REFERENCES BREED (ID)
1010
ALTER TABLE OWNER AUTO_INCREMENT=10
1111
ALTER TABLE BREED AUTO_INCREMENT=10
1212
ALTER TABLE PET AUTO_INCREMENT=20

0 commit comments

Comments
 (0)