Currently the generator outputs comments like this:
{code} comment on column T_JES_COMMANDATTEMPTS is 'Type:Integer,Anzahl der Retries'; {code}
Notice the missing dot / point to separate the table name (T_JES_COMMAND) and the column name (ATTEMPTS).
The problem can be fixed by overriding the applyComments method of the StandardTableExporter class as follows:
{code} public class MobiOracle10gDialect extends Oracle10gDialect { @Override public boolean supportsUniqueConstraintInCreateAlterTable() { return false; }
@Override public Exporter<Table> getTableExporter() { return new StandardTableExporter(this){ protected void applyComments(Table table, QualifiedName tableName, List<String> sqlStrings) { if ( dialect.supportsCommentOn() ) { if ( table.getComment() != null ) { sqlStrings.add( "comment on table " + tableName + " is '" + table.getComment() + "'" ); } final Iterator iter = table.getColumnIterator(); while ( iter.hasNext() ) { Column column = (Column) iter.next(); String columnComment = column.getComment(); if ( columnComment != null ) { //this line is buggy in hibernate 5 :-( //the point is missing between table name and column! sqlStrings.add( "comment on column " + tableName + "." + column.getQuotedName( dialect ) + " is '" + columnComment + "'" ); } } } } }; } } {code}
Compare this line:
{code} sqlStrings.add( "comment on column " + tableName + "." + column.getQuotedName( dialect ) + " is '" + columnComment + "'" ); {code}
with the original:
{code} sqlStrings.add( "comment on column " + tableName + column.getQuotedName( dialect ) + " is '" + columnComment + "'" ); {code}
Notice the missing dot.
|
|