AbstractQueryBuilder
Base class for all builders that can return results as data rows (via SELECT or RETURNING clause).
Unifies the API for terminal methods (toList, toSingle, toField, etc.) and the logic for building queries with WITH clauses (Common Table Expressions). Uses generics to provide a fluent interface in subclasses.
Inheritors
Constructors
Properties
Functions
Converts this builder to a StepBuilder, which enables lazy execution within a transaction. Returns a wrapper with terminal methods that create TransactionStep instead of executing the query.
Builds the SQL fragment for the RETURNING clause.
Creates a formatted SQL fragment for the WITH clause based on added queries. Each CTE is on a new line for readability.
Copies state from another builder of the same type. Used by copy() methods in derived classes.
Executes a modifying query (without RETURNING) and returns the number of affected rows. Throws an exception if a RETURNING clause was used - in that case, use toList(), toSingle(), etc. methods instead.
Generic function for executing queries, wrapping logic in error handling, type conversion, and logging.
Executes the query and returns the value from the first column of the first row. Always fails on empty result.
Executes the query and maps the result to a single object of the given type.
Executes the query and returns the first row. Always fails on empty result.