initial commit with apps from course repo
This commit is contained in:
18
todo-api-swarm/target/classes/META-INF/persistence.xml
Normal file
18
todo-api-swarm/target/classes/META-INF/persistence.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<persistence version="2.1"
|
||||
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
|
||||
<persistence-unit name="Items" transaction-type="JTA">
|
||||
<jta-data-source>java:jboss/datasources/MySQLDS</jta-data-source>
|
||||
<properties>
|
||||
<property name="javax.persistence.schema-generation.database.action" value="none"/>
|
||||
<property name="javax.persistence.schema-generation.create-source" value="script"/>
|
||||
<property name="javax.persistence.schema-generation.drop-source" value="script"/>
|
||||
<property name="javax.persistence.schema-generation.create-script-source" value="sql/create.sql"/>
|
||||
<property name="javax.persistence.schema-generation.drop-script-source" value="sql/drop.sql"/>
|
||||
<property name="javax.persistence.sql-load-script-source" value="sql/load.sql"/>
|
||||
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
|
||||
</properties>
|
||||
</persistence-unit>
|
||||
</persistence>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright 2015 Red Hat, Inc. and/or its affiliates.
|
||||
~
|
||||
~ Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
|
||||
-->
|
||||
<module xmlns="urn:jboss:module:1.3" name="com.mysql">
|
||||
|
||||
<resources>
|
||||
<artifact name="mysql:mysql-connector-java:6.0.6"/>
|
||||
</resources>
|
||||
<dependencies>
|
||||
<module name="javax.api"/>
|
||||
<module name="javax.transaction.api"/>
|
||||
</dependencies>
|
||||
</module>
|
||||
13
todo-api-swarm/target/classes/project-defaults.yml
Normal file
13
todo-api-swarm/target/classes/project-defaults.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
swarm:
|
||||
datasources:
|
||||
jdbc-drivers:
|
||||
com.mysql:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
xa-datasource-class-name: com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
|
||||
driver-module-name: com.mysql
|
||||
data-sources:
|
||||
MySQLDS:
|
||||
driver-name: com.mysql
|
||||
connection-url: jdbc:mysql://${env.DATABASE_SVC_HOSTNAME}:3306/${env.DATABASE_NAME}
|
||||
user-name: ${env.DATABASE_USER}
|
||||
password: ${env.DATABASE_PASSWORD}
|
||||
1
todo-api-swarm/target/classes/sql/create.sql
Normal file
1
todo-api-swarm/target/classes/sql/create.sql
Normal file
@@ -0,0 +1 @@
|
||||
CREATE TABLE `Item` (`id` BIGINT not null auto_increment primary key, `description` VARCHAR(100), `done` BIT);
|
||||
1
todo-api-swarm/target/classes/sql/drop.sql
Normal file
1
todo-api-swarm/target/classes/sql/drop.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE `Item`;
|
||||
2
todo-api-swarm/target/classes/sql/load.sql
Normal file
2
todo-api-swarm/target/classes/sql/load.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
INSERT INTO `Item` (`id`,`description`,`done`) VALUES (1,'Pick up newspaper', 0);
|
||||
INSERT INTO `Item` (`id`,`description`,`done`) VALUES (2,'Buy groceries', 1);
|
||||
Reference in New Issue
Block a user