Module org.jooq
Package org.jooq

Interface Formatter


public interface Formatter
A set of Field formatting expressions that allow for formatting a Field when embedding it in SQLDataType.JSON, SQLDataType.JSONB, or SQLDataType.XML.

Implementations should ensure:

  • That FormatterContext.multiset() vs non-multiset specific behaviour is distinguished, if necessary
  • That NULL behaviour is maintained.

Comparison to other API types

Unlike Formattable, which talks about formatting data to JSON, XML, and other text types in the client using Java, the Formatter takes care of doing this directly in SQL.

Unlike Converter, the formatting affects how the RDBMS embeds the value into a JSON or XML datastructure before sending the data to the client. A Converter is applied only after fetching data from JDBC.

Author:
Lukas Eder