Interface QOM.JSONConcat

All Superinterfaces:
Field<JSON>, FieldOrConstraint, FieldOrRow, FieldOrRowOrSelect, GroupField, Named, OrderField<JSON>, QueryPart, SelectField<JSON>, SelectFieldOrAsterisk, Serializable, TableElement, Typed<JSON>
Enclosing class:
QOM

public static interface QOM.JSONConcat extends Field<JSON>
The JSON CONCAT function.

Concatenate two JSON documents.

This works like PostgreSQL's JSONB || JSONB operator:

  • Two arrays are concatenated into a single array.
  • Two objects are merged into a single object. If both objects contain the same key, the second object's value is retained.
  • In all other cases, non-array values are wrapped in an array, and the resulting arrays are concatenated.
Dialects without native support for object merging may emulate it using JSON_MERGE_PATCH (RFC 7396), which merges nested objects recursively and removes keys whose value is null in the second object.
Author:
Lukas Eder