HHH-10678 - Fix hbm hibernate-mapping's schema attribute is ignored
This commit is contained in:
parent
d6db50897a
commit
b6d010c07a
|
@ -28,8 +28,8 @@ public class InLineViewSourceImpl
|
|||
String logicalName,
|
||||
String comment) {
|
||||
super( mappingDocument );
|
||||
this.schemaName = schemaName;
|
||||
this.catalogName = catalogName;
|
||||
this.schemaName = determineSchemaName( mappingDocument, schemaName );
|
||||
this.catalogName = determineCatalogName( mappingDocument, catalogName );
|
||||
this.selectStatement = selectStatement;
|
||||
this.logicalName = logicalName;
|
||||
this.comment = comment;
|
||||
|
@ -59,4 +59,12 @@ public class InLineViewSourceImpl
|
|||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
private String determineCatalogName(MappingDocument mappingDocument, String catalogName) {
|
||||
return catalogName != null ? catalogName : mappingDocument.getDocumentRoot().getCatalog();
|
||||
}
|
||||
|
||||
private String determineSchemaName(MappingDocument mappingDocument, String schemaName) {
|
||||
return schemaName != null ? schemaName : mappingDocument.getDocumentRoot().getSchema();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ public class TableSourceImpl extends AbstractHbmSourceNode implements TableSourc
|
|||
String comment,
|
||||
String checkConstraint) {
|
||||
super( mappingDocument );
|
||||
this.explicitCatalog = explicitCatalog;
|
||||
this.explicitSchema = explicitSchema;
|
||||
this.explicitCatalog = determineCatalogName( mappingDocument, explicitCatalog );;
|
||||
this.explicitSchema = determineSchemaName( mappingDocument, explicitSchema );;
|
||||
this.explicitTableName = explicitTableName;
|
||||
this.rowId = rowId;
|
||||
this.comment = comment;
|
||||
|
@ -67,4 +67,12 @@ public class TableSourceImpl extends AbstractHbmSourceNode implements TableSourc
|
|||
public String getCheckConstraint() {
|
||||
return checkConstraint;
|
||||
}
|
||||
|
||||
private String determineCatalogName(MappingDocument mappingDocument, String catalogName) {
|
||||
return catalogName != null ? catalogName : mappingDocument.getDocumentRoot().getCatalog();
|
||||
}
|
||||
|
||||
private String determineSchemaName(MappingDocument mappingDocument, String schemaName) {
|
||||
return schemaName != null ? schemaName : mappingDocument.getDocumentRoot().getSchema();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue