Skip to content

Commit

Permalink
HHH-11598 - Use the default catalog when scanning the tables for hbm2…
Browse files Browse the repository at this point in the history
…ddl schema migration
  • Loading branch information
vladmihalcea committed Mar 28, 2017
1 parent 1ce9e24 commit e6d2ff4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
Expand Up @@ -418,7 +418,15 @@ private TableInformation locateTableInNamespace(

if ( extractionContext.getJdbcEnvironment().getNameQualifierSupport().supportsCatalogs() ) {
if ( catalog == null ) {
catalogFilter = "";
String defaultCatalog = "";
if ( extractionContext.getJdbcEnvironment().getNameQualifierSupport().supportsCatalogs() ) {
try {
defaultCatalog = extractionContext.getJdbcConnection().getCatalog();
}
catch (SQLException ignore) {
}
}
catalogFilter = defaultCatalog;
}
else {
catalogToUse = catalog;
Expand Down
Expand Up @@ -163,6 +163,12 @@ public ExceptionHandler getExceptionHandler() {
TargetDescriptorImpl.INSTANCE
);

new IndividuallySchemaMigratorImpl( tool, DefaultSchemaFilter.INSTANCE ).doMigration(
metadata,
options,
TargetDescriptorImpl.INSTANCE
);

new SchemaDropperImpl( tool ).doDrop(
metadata,
options,
Expand Down
10 changes: 5 additions & 5 deletions libraries.gradle
Expand Up @@ -93,14 +93,14 @@ ext {
h2: "com.h2database:h2:${h2Version}",
hsqldb: "org.hsqldb:hsqldb:2.3.2",
derby: "org.apache.derby:derby:10.11.1.1",
postgresql: 'org.postgresql:postgresql:9.4-1202-jdbc41',
mysql: 'mysql:mysql-connector-java:6.0.5',
postgresql: 'org.postgresql:postgresql:9.4.1212',
mysql: 'mysql:mysql-connector-java:6.0.5',
mariadb: 'org.mariadb.jdbc:mariadb-java-client:1.5.7',

oracle: 'com.oracle.ojdbc:ojdbc7:12.1.0.2.0',
mssql: 'com.microsoft.sqlserver:mssql-jdbc:6.1.0.jre8',
oracle: 'com.oracle.jdbc:ojdbc7:12.1.0.2',
mssql: 'com.microsoft.sqlserver:mssql-jdbc:6.1.0.jre8',

informix: 'com.ibm.informix:jdbc:4.10.7.20160517',
informix: 'com.ibm.informix:jdbc:4.10.7.20160517',
jboss_jta: "org.jboss.jbossts:jbossjta:4.16.4.Final",
xapool: "com.experlog:xapool:1.5.0",
mockito: 'org.mockito:mockito-core:2.7.5',
Expand Down

0 comments on commit e6d2ff4

Please sign in to comment.