Skip to content

Commit 68298bb

Browse files
committed
HHH-10650 - Hibernate SchemaExport does not filter ForeignKey for namespaces and tables
1 parent add68bb commit 68298bb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hibernate-core/src/main/java/org/hibernate/tool/schema/internal/SchemaCreatorImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,14 @@ public void createFromMetadata(
355355
for ( Namespace namespace : database.getNamespaces() ) {
356356
// NOTE : Foreign keys must be created *after* unique keys for numerous DBs. See HHH-8390
357357

358+
if ( !schemaFilter.includeNamespace( namespace ) ) {
359+
continue;
360+
}
361+
358362
for ( Table table : namespace.getTables() ) {
363+
if ( !schemaFilter.includeTable( table ) ) {
364+
continue;
365+
}
359366
// foreign keys
360367
final Iterator fkItr = table.getForeignKeyIterator();
361368
while ( fkItr.hasNext() ) {

0 commit comments

Comments
 (0)