File tree Expand file tree Collapse file tree 5 files changed +18
-6
lines changed
hibernate-core/src/main/java/org/hibernate/boot/model/source Expand file tree Collapse file tree 5 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,8 @@ public static TableSpecificationSource createTableSource(
233
233
: tableInformationContainer .getSubselect (),
234
234
tableInformationContainer .getTable () == null
235
235
? inLineViewNameInferrer .inferInLineViewName ()
236
- : tableInformationContainer .getTable ()
236
+ : tableInformationContainer .getTable (),
237
+ comment
237
238
);
238
239
}
239
240
}
Original file line number Diff line number Diff line change @@ -18,17 +18,21 @@ public class InLineViewSourceImpl
18
18
private final String catalogName ;
19
19
private final String selectStatement ;
20
20
private final String logicalName ;
21
+ private final String comment ;
21
22
22
23
public InLineViewSourceImpl (
23
24
MappingDocument mappingDocument ,
24
25
String schemaName ,
25
26
String catalogName ,
26
- String selectStatement , String logicalName ) {
27
+ String selectStatement ,
28
+ String logicalName ,
29
+ String comment ) {
27
30
super ( mappingDocument );
28
31
this .schemaName = schemaName ;
29
32
this .catalogName = catalogName ;
30
33
this .selectStatement = selectStatement ;
31
34
this .logicalName = logicalName ;
35
+ this .comment = comment ;
32
36
}
33
37
34
38
@ Override
@@ -50,4 +54,9 @@ public String getSelectStatement() {
50
54
public String getLogicalName () {
51
55
return logicalName ;
52
56
}
57
+
58
+ @ Override
59
+ public String getComment () {
60
+ return comment ;
61
+ }
53
62
}
Original file line number Diff line number Diff line change @@ -2895,11 +2895,12 @@ public MetadataBuildingContext getBuildingContext() {
2895
2895
if ( isTable ) {
2896
2896
final TableSource tableSource = (TableSource ) tableSpecSource ;
2897
2897
table .setRowId ( tableSource .getRowId () );
2898
- table .setComment ( tableSource .getComment () );
2899
2898
if ( StringHelper .isNotEmpty ( tableSource .getCheckConstraint () ) ) {
2900
2899
table .addCheckConstraint ( tableSource .getCheckConstraint () );
2901
2900
}
2902
- }
2901
+ }
2902
+
2903
+ table .setComment (tableSpecSource .getComment ());
2903
2904
2904
2905
mappingDocument .getMetadataCollector ().addTableNameBinding ( logicalTableName , table );
2905
2906
Original file line number Diff line number Diff line change @@ -21,7 +21,5 @@ public interface TableSource extends TableSpecificationSource {
21
21
22
22
String getRowId ();
23
23
24
- String getComment ();
25
-
26
24
String getCheckConstraint ();
27
25
}
Original file line number Diff line number Diff line change @@ -25,4 +25,7 @@ public interface TableSpecificationSource {
25
25
* @return The catalog name. If {@code null}, the binder will apply the default.
26
26
*/
27
27
public String getExplicitCatalogName ();
28
+
29
+ public String getComment ();
30
+
28
31
}
You can’t perform that action at this time.
0 commit comments