HHH-10430: Comment for class is ignored when using subselect in hibernate mapping - Solution
This commit is contained in:
parent
fd21be8705
commit
ff3b54a962
|
@ -233,7 +233,8 @@ public class Helper {
|
|||
: tableInformationContainer.getSubselect(),
|
||||
tableInformationContainer.getTable() == null
|
||||
? inLineViewNameInferrer.inferInLineViewName()
|
||||
: tableInformationContainer.getTable()
|
||||
: tableInformationContainer.getTable(),
|
||||
comment
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,17 +18,21 @@ public class InLineViewSourceImpl
|
|||
private final String catalogName;
|
||||
private final String selectStatement;
|
||||
private final String logicalName;
|
||||
private final String comment;
|
||||
|
||||
public InLineViewSourceImpl(
|
||||
MappingDocument mappingDocument,
|
||||
String schemaName,
|
||||
String catalogName,
|
||||
String selectStatement, String logicalName) {
|
||||
String selectStatement,
|
||||
String logicalName,
|
||||
String comment) {
|
||||
super( mappingDocument );
|
||||
this.schemaName = schemaName;
|
||||
this.catalogName = catalogName;
|
||||
this.selectStatement = selectStatement;
|
||||
this.logicalName = logicalName;
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -50,4 +54,9 @@ public class InLineViewSourceImpl
|
|||
public String getLogicalName() {
|
||||
return logicalName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2895,11 +2895,12 @@ public class ModelBinder {
|
|||
if ( isTable ) {
|
||||
final TableSource tableSource = (TableSource) tableSpecSource;
|
||||
table.setRowId( tableSource.getRowId() );
|
||||
table.setComment( tableSource.getComment() );
|
||||
if ( StringHelper.isNotEmpty( tableSource.getCheckConstraint() ) ) {
|
||||
table.addCheckConstraint( tableSource.getCheckConstraint() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
table.setComment(tableSpecSource.getComment());
|
||||
|
||||
mappingDocument.getMetadataCollector().addTableNameBinding( logicalTableName, table );
|
||||
|
||||
|
|
|
@ -21,7 +21,5 @@ public interface TableSource extends TableSpecificationSource {
|
|||
|
||||
String getRowId();
|
||||
|
||||
String getComment();
|
||||
|
||||
String getCheckConstraint();
|
||||
}
|
||||
|
|
|
@ -25,4 +25,7 @@ public interface TableSpecificationSource {
|
|||
* @return The catalog name. If {@code null}, the binder will apply the default.
|
||||
*/
|
||||
public String getExplicitCatalogName();
|
||||
|
||||
public String getComment();
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue