Skip to content

Commit

Permalink
Fix json view update verification
Browse files Browse the repository at this point in the history
  • Loading branch information
radovanradic committed Jan 27, 2025
1 parent 6ce87f6 commit c7a0ff3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ private void buildUpdateStatement(AnnotationMetadata annotationMetadata, QuerySt
checkDialectSupportsJsonEntity(entity);
// JsonView updates only DATA column
String jsonEntityColumn = getJsonEntityColumn(annotationMetadata);
if (propertiesToUpdate.size() != 1) {
if (propertiesToUpdate.size() > 1 && propertiesToUpdate.keySet().contains(jsonEntityColumn)) {
List<String> nonSupportedColumns = propertiesToUpdate.keySet().stream().filter(s -> !jsonEntityColumn.equals(s)).collect(Collectors.toList());
throw new IllegalStateException("Json View supports only `" + jsonEntityColumn + "` column to be updated. Cannot update: " + nonSupportedColumns);
}
Expand Down

0 comments on commit c7a0ff3

Please sign in to comment.