[jOOQ/jOOQ#14510] Add Field<T>.comment(Comment): Field<T>

This commit is contained in:
Lukas Eder 2023-01-17 15:41:27 +01:00
parent 1907d783eb
commit e9bc9cf5cb
2 changed files with 30 additions and 0 deletions

View File

@ -287,6 +287,22 @@ extends
@NotNull
<U> Field<U> convertTo(Function<? super U, ? extends T> to);
// ------------------------------------------------------------------------
// DDL API
// ------------------------------------------------------------------------
/**
* Attach a {@link Comment} to this field, for use in DDL statements, such
* as {@link DSLContext#createTable(Table)}.
*/
Field<T> comment(String comment);
/**
* Attach a {@link Comment} to this field, for use in DDL statements, such
* as {@link DSLContext#createTable(Table)}.
*/
Field<T> comment(Comment comment);
// ------------------------------------------------------------------------
// Type casts
// ------------------------------------------------------------------------

View File

@ -266,6 +266,20 @@ implements
return as(aliasFunction.apply(this));
}
// ------------------------------------------------------------------------
// XXX: DDL API
// ------------------------------------------------------------------------
@Override
public final Field<T> comment(String comment) {
return comment(DSL.comment(comment));
}
@Override
public final Field<T> comment(Comment comment) {
return DSL.field(getQualifiedName(), getDataType(), comment);
}
// ------------------------------------------------------------------------
// XXX: Type casts
// ------------------------------------------------------------------------