Skip to content

Commit 2765bf8

Browse files
jrenaatsebersole
authored andcommitted
HHH-18037 - Move DerbyDialect to hibernate-community-dialects
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 5bbabcc commit 2765bf8

File tree

84 files changed

+288
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+288
-281
lines changed

.github/hibernate-github-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ develocity:
5353
pattern: "s390x"
5454
replacement: "$0"
5555
- column: "DB"
56-
pattern: "((?:h2|postgres(?:ql)?|pgsql|mysql|mariadb|mssql|derby|tidb|cockroach(?:db)?|oracle|db2|hsqldb|edb|sybase)(?:.*(?=_ci)|.*))(?:_ci)?"
56+
pattern: "((?:h2|postgres(?:ql)?|pgsql|mysql|mariadb|mssql|tidb|cockroach(?:db)?|oracle|db2|hsqldb|edb|sybase)(?:.*(?=_ci)|.*))(?:_ci)?"
5757
replacement: "$1"
5858
- pattern: "main|HEAD|\\d+.\\d+|PR-\\d+"
5959
replacement: "" # Just remove these tags

.github/workflows/contributor-build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
include:
4343
- rdbms: h2
4444
- rdbms: hsqldb
45-
- rdbms: derby
4645
- rdbms: mysql
4746
- rdbms: mariadb
4847
- rdbms: postgresql

ci/build.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ if [ "$RDBMS" == "h2" ]; then
66
goal=""
77
elif [ "$RDBMS" == "hsqldb" ] || [ "$RDBMS" == "hsqldb_2_6" ]; then
88
goal="-Pdb=hsqldb"
9-
elif [ "$RDBMS" == "derby" ]; then
10-
goal="-Pdb=derby"
119
elif [ "$RDBMS" == "mysql" ] || [ "$RDBMS" == "mysql_8_0" ]; then
1210
goal="-Pdb=mysql_ci"
1311
elif [ "$RDBMS" == "mariadb" ] || [ "$RDBMS" == "mariadb_10_4" ]; then

ci/jpa-3.2-tck.Jenkinsfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pipeline {
3636
string(name: 'TCK_VERSION', defaultValue: '3.2.0', description: 'The version of the Jakarta JPA TCK i.e. `2.2.0` or `3.0.1`')
3737
string(name: 'TCK_SHA', defaultValue: '', description: 'The SHA256 of the Jakarta JPA TCK that is distributed under https://download.eclipse.org/jakartaee/persistence/3.1/jakarta-persistence-tck-${TCK_VERSION}.zip.sha256')
3838
string(name: 'TCK_URL', defaultValue: 'https://www.eclipse.org/downloads/download.php?file=/ee4j/jakartaee-tck/jakartaee11/staged/eftl/jakarta-persistence-tck-3.2.0.zip&mirror_id=1', description: 'The URL from which to download the TCK ZIP file. Only needed for testing staged builds. Ensure the TCK_VERSION variable matches the ZIP file name suffix.')
39-
choice(name: 'RDBMS', choices: ['derby','mysql','mssql','oracle','postgresql','db2','sybase'], description: 'The JDK base image version to use for the TCK image.')
39+
choice(name: 'RDBMS', choices: ['mysql','mssql','oracle','postgresql','db2','sybase'], description: 'The JDK base image version to use for the TCK image.')
4040
}
4141
stages {
4242
stage('Build') {
@@ -116,9 +116,7 @@ pipeline {
116116
else {
117117
containerName = params.RDBMS
118118
}
119-
def dockerRunOptions
120-
if ( params.RDBMS != 'derby' ) {
121-
dockerRunOptions = "--network=tck-net -e DB_HOST=${containerName}"
119+
def dockerRunOptions = "--network=tck-net -e DB_HOST=${containerName}"
122120
sh """ \
123121
while IFS= read -r container; do
124122
docker network disconnect tck-net \$container || true
@@ -127,10 +125,6 @@ pipeline {
127125
docker network create tck-net
128126
docker network connect tck-net ${containerName}
129127
"""
130-
}
131-
else {
132-
dockerRunOptions = ""
133-
}
134128
sh """ \
135129
rm -Rf ./results
136130
docker rm -f tck || true

databases/derby/matrix.gradle

Lines changed: 0 additions & 42 deletions
This file was deleted.

databases/derby/resources/hibernate.properties

Lines changed: 0 additions & 25 deletions
This file was deleted.

etc/hibernate.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ hibernate.connection.url jdbc:hsqldb:./build/db/hsqldb/hibernate
103103

104104
## Derby (not supported!)
105105

106-
#hibernate.dialect org.hibernate.dialect.DerbyDialect
106+
#hibernate.dialect org.hibernate.community.dialect.DerbyDialect
107107
#hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
108108
#hibernate.connection.username
109109
#hibernate.connection.password

etc/hibernate.properties.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ hibernate.connection.url @DB_URL@
8989

9090
## Derby (Not supported!)
9191

92-
#hibernate.dialect org.hibernate.dialect.DerbyDialect
92+
#hibernate.dialect org.hibernate.community.dialect.DerbyDialect
9393
#hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
9494
#hibernate.connection.username
9595
#hibernate.connection.password

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CommunityDatabase.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,23 @@ public Dialect createDialect(DialectResolutionInfo info) {
211211
public boolean productNameMatches(String databaseName) {
212212
return databaseName.toLowerCase().startsWith( "timesten" );
213213
}
214+
},
215+
216+
DERBY {
217+
@Override
218+
public Dialect createDialect(DialectResolutionInfo info) {
219+
return new DerbyDialect( info );
220+
}
221+
@Override
222+
public boolean productNameMatches(String databaseName) {
223+
return "Apache Derby".equals( databaseName );
224+
}
225+
@Override
226+
public String getDriverClassName(String jdbcUrl) {
227+
return jdbcUrl.startsWith( "jdbc:derby://" )
228+
? "org.apache.derby.jdbc.ClientDriver"
229+
: "org.apache.derby.jdbc.EmbeddedDriver";
230+
}
214231
};
215232

216233
/**

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CommunityDialectSelector.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ public Class<? extends Dialect> resolve(String name) {
5050
return TeradataDialect.class;
5151
case "TimesTen":
5252
return TimesTenDialect.class;
53+
case "DerbyTenFive":
54+
case "DerbyTenSix":
55+
case "DerbyTenSeven":
56+
case "Derby":
57+
return DerbyDialect.class;
5358
}
5459
return null;
5560
}

0 commit comments

Comments
 (0)