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 logicalName,
|
||||||
String comment) {
|
String comment) {
|
||||||
super( mappingDocument );
|
super( mappingDocument );
|
||||||
this.schemaName = schemaName;
|
this.schemaName = determineSchemaName( mappingDocument, schemaName );
|
||||||
this.catalogName = catalogName;
|
this.catalogName = determineCatalogName( mappingDocument, catalogName );
|
||||||
this.selectStatement = selectStatement;
|
this.selectStatement = selectStatement;
|
||||||
this.logicalName = logicalName;
|
this.logicalName = logicalName;
|
||||||
this.comment = comment;
|
this.comment = comment;
|
||||||
|
@ -59,4 +59,12 @@ public class InLineViewSourceImpl
|
||||||
public String getComment() {
|
public String getComment() {
|
||||||
return comment;
|
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 comment,
|
||||||
String checkConstraint) {
|
String checkConstraint) {
|
||||||
super( mappingDocument );
|
super( mappingDocument );
|
||||||
this.explicitCatalog = explicitCatalog;
|
this.explicitCatalog = determineCatalogName( mappingDocument, explicitCatalog );;
|
||||||
this.explicitSchema = explicitSchema;
|
this.explicitSchema = determineSchemaName( mappingDocument, explicitSchema );;
|
||||||
this.explicitTableName = explicitTableName;
|
this.explicitTableName = explicitTableName;
|
||||||
this.rowId = rowId;
|
this.rowId = rowId;
|
||||||
this.comment = comment;
|
this.comment = comment;
|
||||||
|
@ -67,4 +67,12 @@ public class TableSourceImpl extends AbstractHbmSourceNode implements TableSourc
|
||||||
public String getCheckConstraint() {
|
public String getCheckConstraint() {
|
||||||
return checkConstraint;
|
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