Skip to content

Commit

Permalink
CassandraTypesExtension column name fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodforGod committed Jul 31, 2023
1 parent 1032ed2 commit ed53a0f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ public CassandraTypesExtension(ProcessingEnvironment env) {
}
},
fd -> CodeBlock.builder()
.beginControlFlow("if (_row.isNull($S))", fd.fieldName())
.beginControlFlow("if (_row.isNull($S))", fd.columnName())
.add(fd.nullable()
? CodeBlock.of("$N = null;\n", fd.fieldName())
: CodeBlock.of("throw new $T($S);\n", NullPointerException.class, "Result field %s is not nullable but row has null".formatted(fd.fieldName()))
: CodeBlock.of("throw new $T($S);\n", NullPointerException.class, "Result field %s is not nullable but row %s has null".formatted(fd.fieldName(), fd.columnName()))
)
.endControlFlow()
.build()
Expand Down

0 comments on commit ed53a0f

Please sign in to comment.