Last active
November 8, 2018 14:20
-
-
Save davidema79/b1a6e161177808dfa6dbec1b512e5ce7 to your computer and use it in GitHub Desktop.
Derby, Mule and Flyway
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.name=exams-students | |
db.url=jdbc:derby:memory:${db.name};create=true | |
db.driverClass=org.apache.derby.jdbc.EmbeddedDriver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<properties> | |
[...] | |
<org.apache.derby.version>10.14.2.0</org.apache.derby.version> | |
<spring-jdbc.version>4.1.9.RELEASE</spring-jdbc.version> | |
[...] | |
</properties> | |
[...] | |
<dependencies> | |
[...] | |
<dependency> | |
<groupId>org.apache.derby</groupId> | |
<artifactId>derby</artifactId> | |
<version>${org.apache.derby.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-jdbc</artifactId> | |
<version>${spring-jdbc.version}</version> | |
</dependency> | |
[...] | |
</dependencies> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<context:property-placeholder location="classpath:application.properties"/> | |
<spring:beans> | |
<spring:bean id="standardXADataSource" class="org.enhydra.jdbc.standard.StandardXADataSource" destroy-method="shutdown" name="XADataSource" scope="singleton"> | |
<spring:property name="driverName" value="${db.driverClass}"/> | |
<spring:property name="url" value="${db.url}"/> | |
</spring:bean> | |
[...] | |
</spring:beans> | |
<db:generic-config name="databaseGlobalConfiguration" dataSource-ref="standardXADataSource" doc:name="Generic Database Configuration"/> | |
[...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<spring:beans> | |
[...] | |
<spring:bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate"> | |
<spring:property name="dataSource" ref="standardXADataSource"/> | |
</spring:bean> | |
<spring:beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<properties> | |
[...] | |
<flyway-core.version>5.1.4</flyway-core.version> | |
[...] | |
</properties> | |
[...] | |
<dependencies> | |
[...] | |
<dependency> | |
<groupId>org.flywaydb</groupId> | |
<artifactId>flyway-core</artifactId> | |
<version>${flyway-core.version}</version> | |
</dependency> | |
[...] | |
</dependencies> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<db:select config-ref="databaseGlobalConfiguration" doc:name="Select exams by Professor ID"> | |
<db:parameterized-query> | |
<![CDATA[ | |
SELECT e.*, sbj.name | |
FROM professors p JOIN exams e ON p.id = e.professor_id | |
JOIN subjects sbj ON sbj.id = e.subject_id | |
WHERE p.id = #[flowVars.professorId] | |
]]> | |
</db:parameterized-query> | |
</db:select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<db:select config-ref="databaseGlobalConfiguration" doc:name="Get All Students"> | |
<db:parameterized-query> | |
<![CDATA[ | |
SELECT * | |
FROM students | |
]]> | |
</db:parameterized-query> | |
</db:select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment