Skip to content

Commit

Permalink
HHH-19033 - Restore Derby dialect in the community dialects
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Schatteman <[email protected]>
  • Loading branch information
jrenaat committed Jan 20, 2025
1 parent 6e64d78 commit 700b0ad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,23 @@ public boolean productNameMatches(String databaseName) {
public String getDriverClassName(String jdbcUrl) {
return "com.singlestore.jdbc.Driver";
}
},

DERBY {
@Override
public Dialect createDialect(DialectResolutionInfo info) {
return new DerbyDialect( info );
}
@Override
public boolean productNameMatches(String databaseName) {
return "Apache Derby".equals( databaseName );
}
@Override
public String getDriverClassName(String jdbcUrl) {
return jdbcUrl.startsWith( "jdbc:derby://" )
? "org.apache.derby.jdbc.ClientDriver"
: "org.apache.derby.jdbc.EmbeddedDriver";
}
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public Class<? extends Dialect> resolve(String name) {
return TimesTenDialect.class;
case "SingleStore":
return SingleStoreDialect.class;
case "Derby":
return DerbyDialect.class;
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public void verifyAllDialectNamingResolve() {
testDialectNamingResolution( TeradataDialect.class );
testDialectNamingResolution( TimesTenDialect.class );
testDialectNamingResolution( SingleStoreDialect.class );
testDialectNamingResolution( DerbyDialect.class );
}

private void testDialectNamingResolution(final Class<?> dialectClass) {
Expand Down

0 comments on commit 700b0ad

Please sign in to comment.