[jOOQ/jOOQ#17926] Code generator should consider effective nullability of computed columns just like that of defaulted columns

This commit is contained in:
Lukas Eder 2025-02-13 15:55:01 +01:00
parent 3badd891d7
commit ccbc035635

View File

@ -10208,7 +10208,8 @@ public class JavaGenerator extends AbstractGenerator {
private boolean effectivelyNotNull(DataTypeDefinition type) {
return !type.isNullable()
&& !type.isDefaulted()
&& !type.isIdentity();
&& !type.isIdentity()
&& !type.isComputed();
}
private boolean writeOnlyNullable(JavaWriter out, TypedElementDefinition<?> column) {
@ -10217,7 +10218,7 @@ public class JavaGenerator extends AbstractGenerator {
private boolean writeOnlyNullable(DataTypeDefinition type) {
return !type.isNullable()
&& (type.isDefaulted() || type.isIdentity());
&& (type.isDefaulted() || type.isIdentity() || type.isComputed());
}
private static final Pattern P_IS = Pattern.compile("^is[A-Z].*$");