Module org.jooq
Package org.jooq.impl

Class UpdatableRecordImpl<R extends UpdatableRecord<R>>

java.lang.Object
org.jooq.impl.TableRecordImpl<R>
org.jooq.impl.UpdatableRecordImpl<R>
All Implemented Interfaces:
Serializable, Comparable<Record>, SQLData, Attachable, Fields, Formattable, QualifiedRecord<R>, Record, TableRecord<R>, UpdatableRecord<R>

@Internal public class UpdatableRecordImpl<R extends UpdatableRecord<R>> extends TableRecordImpl<R> implements UpdatableRecord<R>
A record implementation for a record holding a primary key

This type is for JOOQ INTERNAL USE only. Do not reference directly

Author:
Lukas Eder
See Also:
  • Constructor Details

    • UpdatableRecordImpl

      public UpdatableRecordImpl(Table<R> table)
  • Method Details

    • key

      public Record key()
      Description copied from interface: UpdatableRecord
      A Record copy holding values for the Table.getPrimaryKey().

      The returned record consists exactly of those fields as returned by the table's primary key: Key.getFields().

      Generated subtypes may covariantly override this method to add more record type information. For instance, they may return Record1, Record2, ...

      Specified by:
      key in interface UpdatableRecord<R extends UpdatableRecord<R>>
    • fetchChild

      public final <O extends TableRecord<O>> O fetchChild(ForeignKey<O,R> key)
      Description copied from interface: UpdatableRecord
      Fetch a child record of this record, given a foreign key.

      This returns a child record referencing this record through a given foreign key, as if fetching from UpdatableRecord.children(ForeignKey).. If no child record was found, this returns null.

      A separate roundtrip is created by this operation. It is often much better to include parent records using ordinary JOIN mechanisms in a single query, or using nested records, or the MULTISET or MULTISET_AGG operators, see https://www.jooq.org/doc/latest/manual/sql-building/column-expressions/nested-records/, or the https://www.jooq.org/doc/latest/manual/sql-building/column-expressions/multiset-value-constructor/.

      Specified by:
      fetchChild in interface UpdatableRecord<R extends UpdatableRecord<R>>
      See Also:
    • fetchChildren

      public final <O extends TableRecord<O>> Result<O> fetchChildren(ForeignKey<O,R> key)
      Description copied from interface: UpdatableRecord
      Fetch child records of this record, given a foreign key.

      This returns child records referencing this record through a given foreign key, as if fetching from UpdatableRecord.children(ForeignKey).

      A separate roundtrip is created by this operation. It is often much better to include parent records using ordinary JOIN mechanisms in a single query, or using nested records, or the MULTISET or MULTISET_AGG operators, see https://www.jooq.org/doc/latest/manual/sql-building/column-expressions/nested-records/, or the https://www.jooq.org/doc/latest/manual/sql-building/column-expressions/multiset-value-constructor/.

      Specified by:
      fetchChildren in interface UpdatableRecord<R extends UpdatableRecord<R>>
      See Also:
    • children

      public final <O extends TableRecord<O>> Table<O> children(ForeignKey<O,R> key)
      Description copied from interface: UpdatableRecord
      Get a table expression representing the children of this record, given a foreign key.
      Specified by:
      children in interface UpdatableRecord<R extends UpdatableRecord<R>>
    • store

      public final int store()
      Description copied from interface: UpdatableRecord
      Store this record back to the database.

      Depending on the state of the primary key's value, an UpdatableRecord.insert() or an UpdatableRecord.update() statement is executed.

      Statement type

      • If this record was created by client code, an INSERT statement is executed
      • If this record was loaded by jOOQ and the primary key value was changed, an INSERT statement is executed (unless Settings.isUpdatablePrimaryKeys() is set). jOOQ expects that primary key values will never change due to the principle of normalisation in RDBMS. So if client code changes primary key values, this is interpreted by jOOQ as client code wanting to duplicate this record.
      • If this record was loaded by jOOQ, and the primary key value was not changed, an UPDATE statement is executed.

      In either statement type, only those fields are inserted/updated, which had been explicitly set by client code, in order to allow for DEFAULT values to be applied by the underlying RDBMS. If no fields were modified, neither an UPDATE nor an INSERT will be executed.

      Automatic value generation

      Use UpdatableRecord.insert() or UpdatableRecord.update() to explicitly force either statement type.

      • IDENTITY columns

        If there is an IDENTITY column defined on the record's underlying table (see Table.getIdentity()), then the auto-generated IDENTITY value is refreshed automatically on INSERT's. Refreshing is done using Statement.getGeneratedKeys(), where this is supported by the JDBC driver. See also InsertQuery.getReturnedRecord() for more details

      • VERSION and TIMESTAMP columns

        jOOQ can auto-generate "version" and "timestamp" values that can be used for optimistic locking. If this is an UpdatableRecord and if this record returns fields for either Table.getRecordVersion() or Table.getRecordTimestamp(), then these values are set onto the INSERT or UPDATE statement being executed. On execution success, the generated values are set to this record. Use the code-generation configuration to specify naming patterns for auto-generated "version" and "timestamp" columns.

        Should you want to circumvent jOOQ-generated updates to these columns, you can render an INSERT or UPDATE statement manually using the various DSLContext.insertInto(Table), DSLContext.update(Table) methods.

      Optimistic locking

      If an UPDATE statement is executed and Settings.isExecuteWithOptimisticLocking() is set to true, then this record will first be compared with the latest state in the database. There are two modes of operation for optimistic locking:

      • With VERSION and/or TIMESTAMP columns configured

        This is the preferred way of using optimistic locking in jOOQ. If this is an UpdatableRecord and if this record returns fields for either Table.getRecordVersion() or Table.getRecordTimestamp(), then these values are compared to the corresponding value in the database in the WHERE clause of the executed DELETE statement.

      • Without any specific column configurations

        In order to compare this record with the latest state, the database record will be locked pessimistically using a SELECT … FOR UPDATE statement. Not all databases support the FOR UPDATE clause natively. Namely, the following databases will show slightly different behaviour:

        • SQLDialect.SQLSERVER: jOOQ will try to lock the database record using WITH (ROWLOCK, UPDLOCK) hints.
        • SQLDialect.SQLITE: No pessimistic locking is possible. Client code must assure that no race-conditions can occur between jOOQ's checking of database record state and the actual UPDATE

        See SelectQuery.setForUpdate(boolean) for more details

      Statement examples

      Possible statements are

      • 
         INSERT INTO [table] ([modified fields, including keys])
         VALUES ([modified values, including keys])
      • 
         UPDATE [table]
         SET [modified fields = modified values, excluding keys]
         WHERE [key fields = key values]
         AND [version/timestamp fields = version/timestamp values]

      Statement execution enforcement

      If you want to control statement re-execution, regardless if the values in this record were changed, you can explicitly set the changed flags for all values with Record.changed(boolean) or for single values with Record.changed(Field, boolean), prior to storing. Consider also setting the flags Settings.getUpdateUnchangedRecords() and/or Settings.isInsertUnchangedRecords() appropriately to control if the record should be "touched" without any changes (UPDATE) or inserted with default values (INSERT).

      This is the same as calling record.store(record.fields())

      Specified by:
      store in interface UpdatableRecord<R extends UpdatableRecord<R>>
      Returns:
      1 if the record was stored to the database. 0 if storing was not necessary.
      See Also:
    • store

      public final int store(Field<?>... storeFields)
      Description copied from interface: UpdatableRecord
      Store parts of this record to the database.
      Specified by:
      store in interface UpdatableRecord<R extends UpdatableRecord<R>>
      Returns:
      1 if the record was stored to the database. 0 if storing was not necessary.
      See Also:
    • store

      public final int store(Collection<? extends Field<?>> storeFields)
      Description copied from interface: UpdatableRecord
      Store parts of this record to the database.
      Specified by:
      store in interface UpdatableRecord<R extends UpdatableRecord<R>>
      Returns:
      1 if the record was stored to the database. 0 if storing was not necessary.
      See Also:
    • update

      public final int update()
      Description copied from interface: UpdatableRecord
      Store this record back to the database using an UPDATE statement.

      This is the same as UpdatableRecord.store(), except that an UPDATE statement (or no statement) will always be executed.

      If you want to enforce statement execution, regardless if the values in this record were changed, you can explicitly set the changed flags for all values with Record.changed(boolean) or for single values with Record.changed(Field, boolean), prior to updating, or alternatively, use Settings.getUpdateUnchangedRecords().

      This is the same as calling record.update(record.fields())

      Specified by:
      update in interface UpdatableRecord<R extends UpdatableRecord<R>>
      Returns:
      1 if the record was stored to the database. 0 if storing was not necessary.
      See Also:
    • update

      public int update(Field<?>... storeFields)
      Description copied from interface: UpdatableRecord
      Store parts of this record to the database using an UPDATE statement.
      Specified by:
      update in interface UpdatableRecord<R extends UpdatableRecord<R>>
      Returns:
      1 if the record was stored to the database. 0 if storing was not necessary.
      See Also:
    • update

      public final int update(Collection<? extends Field<?>> storeFields)
      Description copied from interface: UpdatableRecord
      Store parts of this record to the database using an UPDATE statement.
      Specified by:
      update in interface UpdatableRecord<R extends UpdatableRecord<R>>
      Returns:
      1 if the record was stored to the database. 0 if storing was not necessary.
      See Also:
    • merge

      public final int merge()
      Description copied from interface: UpdatableRecord
      Store this record back to the database using a MERGE statement.

      Unlike UpdatableRecord.store(), the statement produced by this operation does not depend on whether the record has been previously fetched from the database or created afresh. It implements the semantics of an INSERT … ON DUPLICATE KEY UPDATE statement, which will update the row regardless of which (unique) key value is already present. See InsertOnDuplicateStep.onDuplicateKeyUpdate().

      When optimistic locking is active for this record, then this operation will execute UpdatableRecord.insert() or UpdatableRecord.update() explicitly, depending on whether the lock values are present already in the record.

      If you want to enforce statement execution, regardless if the values in this record were changed, you can explicitly set the changed flags for all values with Record.changed(boolean) or for single values with Record.changed(Field, boolean), prior to insertion.

      This is the same as calling record.merge(record.fields())

      Specified by:
      merge in interface UpdatableRecord<R extends UpdatableRecord<R>>
      Returns:
      1 if the record was merged to the database. 0 if merging was not necessary.
      See Also:
    • merge

      public int merge(Field<?>... storeFields)
      Description copied from interface: UpdatableRecord
      Store parts of this record to the database using a MERGE statement.
      Specified by:
      merge in interface UpdatableRecord<R extends UpdatableRecord<R>>
      Returns:
      1 if the record was merged to the database. 0 if merging was not necessary.
      See Also:
    • merge

      public final int merge(Collection<? extends Field<?>> storeFields)
      Description copied from interface: UpdatableRecord
      Store parts of this record to the database using a MERGE statement.
      Specified by:
      merge in interface UpdatableRecord<R extends UpdatableRecord<R>>
      Returns:
      1 if the record was merged to the database. 0 if merging was not necessary.
      See Also:
    • delete

      public final int delete()
      Description copied from interface: UpdatableRecord
      Deletes this record from the database, based on the value of the primary key or main unique key.

      Optimistic locking

      If a DELETE statement is executed and Settings.isExecuteWithOptimisticLocking() is set to true, then this record will first be compared with the latest state in the database. There are two modes of operation for optimistic locking:

      • With VERSION and/or TIMESTAMP columns configured

        This is the preferred way of using optimistic locking in jOOQ. If this is an UpdatableRecord and if this record returns fields for either Table.getRecordVersion() or Table.getRecordTimestamp(), then these values are compared to the corresponding value in the database in the WHERE clause of the executed DELETE statement.

      • Without any specific column configurations

        In order to compare this record with the latest state, the database record will be locked pessimistically using a SELECT … FOR UPDATE statement. Not all databases support the FOR UPDATE clause natively. Namely, the following databases will show slightly different behaviour:

        • SQLDialect.SQLSERVER: jOOQ will try to lock the database record using WITH (ROWLOCK, UPDLOCK) hints.
        • SQLDialect.SQLITE: No pessimistic locking is possible. Client code must assure that no race-conditions can occur between jOOQ's checking of database record state and the actual DELETE

        See SelectQuery.setForUpdate(boolean) for more details

      Statement examples

      The executed statement is

      
       DELETE FROM [table]
       WHERE [key fields = key values]
       AND [version/timestamp fields = version/timestamp values]

      This is in fact the same as calling delete(getTable().getPrimaryKey().getFieldsArray())

      Specified by:
      delete in interface UpdatableRecord<R extends UpdatableRecord<R>>
      Returns:
      1 if the record was deleted from the database. 0 if deletion was not necessary.
    • refresh

      public final void refresh()
      Description copied from interface: UpdatableRecord
      Refresh this record from the database.

      A successful refresh results in the following:

      Refreshing can trigger any of the following actions:

      • Executing a new SELECT statement, if this is an UpdatableRecord.
      • Failing, otherwise

      This is the same as calling record.refresh(record.fields())

      Specified by:
      refresh in interface UpdatableRecord<R extends UpdatableRecord<R>>
    • refresh

      public final void refresh(Field<?>... refreshFields)
      Description copied from interface: UpdatableRecord
      Refresh parts of this record from the database.

      A successful refresh results in the following:

      Refreshing can trigger any of the following actions:

      • Executing a new SELECT statement, if this is an UpdatableRecord.
      • Failing, otherwise

      This is the same as calling record.refresh(record.fields())

      Specified by:
      refresh in interface UpdatableRecord<R extends UpdatableRecord<R>>
    • refresh

      public final void refresh(Collection<? extends Field<?>> refreshFields)
      Description copied from interface: UpdatableRecord
      Refresh parts of this record from the database.

      A successful refresh results in the following:

      Refreshing can trigger any of the following actions:

      • Executing a new SELECT statement, if this is an UpdatableRecord.
      • Failing, otherwise

      This is the same as calling record.refresh(record.fields())

      Specified by:
      refresh in interface UpdatableRecord<R extends UpdatableRecord<R>>
    • copy

      public final R copy()
      Description copied from interface: UpdatableRecord
      Duplicate this record (in memory) and reset all fields from the primary key or main unique key, such that a subsequent call to UpdatableRecord.store() will result in an INSERT statement.
      Specified by:
      copy in interface UpdatableRecord<R extends UpdatableRecord<R>>
      Returns:
      A new record, distinct from this record.
    • getQualifier

      public final RecordQualifier<R> getQualifier()
      Description copied from interface: QualifiedRecord
      Get the UDT or Table reference.
      Specified by:
      getQualifier in interface QualifiedRecord<R extends QualifiedRecord<R>>
    • with

      public final <T> R with(Field<T> field, T value)
      Description copied from interface: Record
      Set a value into this record, using Fields.field(Field) for lookup.

      Like Record.set(Field, Object) but returning this for fluent setting of multiple values.

      Specified by:
      with in interface QualifiedRecord<R extends QualifiedRecord<R>>
      Specified by:
      with in interface Record
    • with

      public final <T, U> R with(Field<T> field, U value, Converter<? extends T,? super U> converter)
      Description copied from interface: Record
      Set a value into this record, using Fields.field(Field) for lookup.

      Like Record.set(Field, Object, Converter) but returning this for fluent setting of multiple values.

      Specified by:
      with in interface QualifiedRecord<R extends QualifiedRecord<R>>
      Specified by:
      with in interface Record
    • fieldsRow

      public Row fieldsRow()
      Description copied from interface: Fields
      Get all fields known to this type as a Row.
      Specified by:
      fieldsRow in interface Fields
    • valuesRow

      public Row valuesRow()
      Description copied from interface: Record
      Get this record's values as a Row.
      Specified by:
      valuesRow in interface Record
    • getSQLTypeName

      public final String getSQLTypeName() throws SQLException
      Specified by:
      getSQLTypeName in interface SQLData
      Throws:
      SQLException
    • readSQL

      public final void readSQL(SQLInput stream, String typeName) throws SQLException
      Specified by:
      readSQL in interface SQLData
      Throws:
      SQLException
    • writeSQL

      public final void writeSQL(SQLOutput stream) throws SQLException
      Specified by:
      writeSQL in interface SQLData
      Throws:
      SQLException
    • fields

      public final Field<?>[] fields()
      Description copied from interface: Fields
      Get all fields known to this type.
      Specified by:
      fields in interface Fields
    • fieldStream

      public final Stream<Field<?>> fieldStream()
      Description copied from interface: Fields
      Get all fields known to this type as a Stream.
      Specified by:
      fieldStream in interface Fields
    • field

      public final <T> Field<T> field(Field<T> field)
      Description copied from interface: Fields
      Get a field known to this type by field reference.

      This will return:

      • A field that is the same as the argument field (by identity comparison).
      • A field that is equal to the argument field (exact matching fully qualified name).
      • A field that is equal to the argument field (partially matching qualified name).
      • A field whose name is equal to the unqualified name of the argument field.
      • null otherwise.

      If several fields have the same ambiguous name, the first one is returned and a warning is logged.

      Specified by:
      field in interface Fields
    • field

      public final Field<?> field(String name)
      Description copied from interface: Fields
      Get a field known to this type by unqualified name, or null if no field is known to this type by this name.

      If several fields have the same ambiguous name, the first one is returned and a warning is logged.

      Specified by:
      field in interface Fields
      Parameters:
      name - The unqualified name of the field
    • field

      public final <T> Field<T> field(String name, Class<T> type)
      Description copied from interface: Fields
      Get a field known to this type by unqualified name coerced to type, or null if no field is known to this type by this name.

      If several fields have the same ambiguous name, the first one is returned and a warning is logged.

      Specified by:
      field in interface Fields
      Parameters:
      name - The unqualified name of the field
      type - The type to coerce the resulting field to
    • field

      public final <T> Field<T> field(String name, DataType<T> dataType)
      Description copied from interface: Fields
      Get a field known to this type by unqualified name coerced to dataType, or null if no field is known to this type by this name.

      If several fields have the same ambiguous name, the first one is returned and a warning is logged.

      Specified by:
      field in interface Fields
      Parameters:
      name - The unqualified name of the field
      dataType - The data type to coerce the resulting field to
    • field

      public final Field<?> field(Name name)
      Description copied from interface: Fields
      Get a field known to this type by qualified name, or null if no field is known to this type by this name.

      This will return:

      • A field whose name is equal to the argument field's name (exact matching fully qualified name).
      • A field whose name is equal to the argument field's name (partially matching qualified name).
      • A field whose name is equal to the unqualified name of the argument field.
      • null otherwise.

      If several fields have the same ambiguous name, the first one is returned and a warning is logged.

      Specified by:
      field in interface Fields
      Parameters:
      name - The qualified name of the field
    • field

      public final <T> Field<T> field(Name name, Class<T> type)
      Description copied from interface: Fields
      Get a field known to this type by qualified name coerced to type, or null if no field is known to this type by this name.

      This will return:

      • A field whose name is equal to the argument field's name (exact matching fully qualified name).
      • A field whose name is equal to the argument field's name (partially matching qualified name).
      • A field whose name is equal to the unqualified name of the argument field.
      • null otherwise.

      If several fields have the same ambiguous name, the first one is returned and a warning is logged.

      Specified by:
      field in interface Fields
      Parameters:
      name - The qualified name of the field
      type - The type to coerce the resulting field to
    • field

      public final <T> Field<T> field(Name name, DataType<T> dataType)
      Description copied from interface: Fields
      Get a field known to this type by qualified name coerced to dataType, or null if no field is known to this type by this name.

      This will return:

      • A field whose name is equal to the argument field's name (exact matching fully qualified name).
      • A field whose name is equal to the argument field's name (partially matching qualified name).
      • A field whose name is equal to the unqualified name of the argument field.
      • null otherwise.

      If several fields have the same ambiguous name, the first one is returned and a warning is logged.

      Specified by:
      field in interface Fields
      Parameters:
      name - The qualified name of the field
      dataType - The data type to coerce the resulting field to
    • field

      public final Field<?> field(int index)
      Description copied from interface: Fields
      Get a field known to this type by index, or null if no field is available at the index.
      Specified by:
      field in interface Fields
      Parameters:
      index - The 0-based index of the field
    • field

      public final <T> Field<T> field(int index, Class<T> type)
      Description copied from interface: Fields
      Get a field known to this type by index coerced to type, or null if no field is available at the index.
      Specified by:
      field in interface Fields
      Parameters:
      index - The 0-based index of the field
      type - The type to coerce the resulting field to
    • field

      public final <T> Field<T> field(int index, DataType<T> dataType)
      Description copied from interface: Fields
      Get a field known to this type by index coerced to dataType, or null if no field is available at the index.
      Specified by:
      field in interface Fields
      Parameters:
      index - The 0-based index of the field
      dataType - The data type to coerce the resulting field to
    • fields

      public final Field<?>[] fields(Field<?>... f)
      Description copied from interface: Fields
      Get all fields, filtering by some fields.
      Specified by:
      fields in interface Fields
      Parameters:
      f - The fields to include after looking them up via Fields.field(Field).
      See Also:
    • fields

      public final Field<?>[] fields(String... fieldNames)
      Description copied from interface: Fields
      Get all fields known to this type, filtering by some unqualified field names.
      Specified by:
      fields in interface Fields
      Parameters:
      fieldNames - The unqualified field names to include after looking them up via Fields.field(String).
      See Also:
    • fields

      public final Field<?>[] fields(Name... fieldNames)
      Description copied from interface: Fields
      Get all fields known to this type, filtering by some qualified field names.
      Specified by:
      fields in interface Fields
      Parameters:
      fieldNames - The qualified field names to include after looking them up via Fields.field(Name).
      See Also:
    • fields

      public final Field<?>[] fields(int... fieldIndexes)
      Description copied from interface: Fields
      Get all fields known to this type, filtering by some field indexes.
      Specified by:
      fields in interface Fields
      See Also:
    • indexOf

      public final int indexOf(Field<?> field)
      Description copied from interface: Fields
      Get a field's index from this type.

      The lookup algorithm is the same as that of Fields.field(Field).

      Specified by:
      indexOf in interface Fields
      Parameters:
      field - The field to look for
      Returns:
      The field's 0-based index or -1 if the field is not known to this type.
    • indexOf

      public final int indexOf(String fieldName)
      Description copied from interface: Fields
      Get a field's index from this type.

      The lookup algorithm is the same as that of Fields.field(String).

      Specified by:
      indexOf in interface Fields
      Parameters:
      fieldName - The unqualified field name to look for
      Returns:
      The field's 0-based index or -1 if the field is not known to this type.
    • indexOf

      public final int indexOf(Name fieldName)
      Description copied from interface: Fields
      Get a field's index from this type.

      The lookup algorithm is the same as that of Fields.field(Name).

      Specified by:
      indexOf in interface Fields
      Parameters:
      fieldName - The qualified field name to look for
      Returns:
      The field's 0-based index or -1 if the field is not known to this type.
    • types

      public final Class<?>[] types()
      Description copied from interface: Fields
      Get an array of field types for fields known to this type.

      Entries in the resulting array correspond to Typed.getType() for the corresponding Field in Fields.fields()

      Specified by:
      types in interface Fields
    • type

      public final Class<?> type(int fieldIndex)
      Description copied from interface: Fields
      Get the field type for a given field index, or null if no field is available at the index.
      Specified by:
      type in interface Fields
      Parameters:
      fieldIndex - The field's 0-based index
    • type

      public final Class<?> type(String fieldName)
      Description copied from interface: Fields
      Get the field type for a given unqualified field name, or null if no field is known to this type by this name.

      The lookup algorithm is the same as that of Fields.field(String).

      Specified by:
      type in interface Fields
      Parameters:
      fieldName - The unqualified field name
    • type

      public final Class<?> type(Name fieldName)
      Description copied from interface: Fields
      Get the field type for a given qualified field name, or null if no field is known to this type by this name.

      The lookup algorithm is the same as that of Fields.field(Name).

      Specified by:
      type in interface Fields
      Parameters:
      fieldName - The qualified field name
    • dataTypes

      public final DataType<?>[] dataTypes()
      Description copied from interface: Fields
      Get an array of field data types for this type.

      Entries in the resulting array correspond to Typed.getDataType() for the corresponding Field in Fields.fields()

      Specified by:
      dataTypes in interface Fields
    • dataType

      public final DataType<?> dataType(int fieldIndex)
      Description copied from interface: Fields
      Get the field data type for a given field index, or null if no field is available at the index.
      Specified by:
      dataType in interface Fields
      Parameters:
      fieldIndex - The field's 0-based index
    • dataType

      public final DataType<?> dataType(String fieldName)
      Description copied from interface: Fields
      Get the field data type for a given qualified field name, or null if no field is known to this type by this name.

      The lookup algorithm is the same as that of Fields.field(String).

      Specified by:
      dataType in interface Fields
      Parameters:
      fieldName - The qualified field name
    • dataType

      public final DataType<?> dataType(Name fieldName)
      Description copied from interface: Fields
      Get the field data type for a given qualified field name, or null if no field is known to this type by this name.

      The lookup algorithm is the same as that of Fields.field(Name).

      Specified by:
      dataType in interface Fields
      Parameters:
      fieldName - The qualified field name
    • size

      public final int size()
      Description copied from interface: Record
      Get the number of fields of this record.
      Specified by:
      size in interface Record
    • get

      public final <T> T get(Field<T> field)
      Description copied from interface: Record
      Get a value from this Record, providing a field, using Fields.field(Field) for lookup.

      If this record contains a field with the same Field.getName() as the argument field, that value is retrieved.

      Specified by:
      get in interface Record
      Type Parameters:
      T - The generic field parameter
      Parameters:
      field - The field
      Returns:
      The value of a field contained in this record
    • get

      public final <U> U get(Field<?> field, Class<? extends U> type)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field, using Fields.field(Field) for lookup.

      The Converter that is provided by Configuration.converterProvider() will be used to convert the value to U

      If this record contains a field with the same Field.getName() as the argument field, that value is retrieved.

      Specified by:
      get in interface Record
      Type Parameters:
      U - The conversion type parameter
      Parameters:
      field - The field
      type - The conversion type
      Returns:
      The value of a field contained in this record
    • get

      public final <T, U> U get(Field<T> field, Converter<? super T,? extends U> converter)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field, using Fields.field(Field) for lookup.

      If this record contains a field with the same Field.getName() as the argument field, that value is retrieved.

      Specified by:
      get in interface Record
      Type Parameters:
      T - The database type parameter
      U - The conversion type parameter
      Parameters:
      field - The field
      converter - The data type converter
      Returns:
      The value of a field contained in this record
    • get

      public final Object get(int index)
      Description copied from interface: Record
      Get a value from this record, providing a field index.
      Specified by:
      get in interface Record
      Parameters:
      index - The 0-based field index in this record.
      Returns:
      The value of a field's index contained in this record
    • get

      public final <U> U get(int index, Class<? extends U> type)
      Description copied from interface: Record
      Get a converted value from this record, providing a field index.

      The Converter that is provided by Configuration.converterProvider() will be used to convert the value to U

      Specified by:
      get in interface Record
      Type Parameters:
      U - The conversion type parameter
      Parameters:
      index - The 0-based field index in this record.
      type - The conversion type
      Returns:
      The value of a field's index contained in this record
    • get

      public final <U> U get(int index, Converter<?,? extends U> converter)
      Description copied from interface: Record
      Get a converted value from this record, providing a field index.
      Specified by:
      get in interface Record
      Type Parameters:
      U - The conversion type parameter
      Parameters:
      index - The 0-based field index in this record.
      converter - The data type converter
      Returns:
      The value of a field's index contained in this record
    • get

      public final Object get(String fieldName)
      Description copied from interface: Record
      Get a value from this Record, providing a field name, using Fields.field(String) for lookup.
      Specified by:
      get in interface Record
      Parameters:
      fieldName - The field's name
      Returns:
      The value of a field's name contained in this record
    • get

      public final <T> T get(String fieldName, Class<? extends T> type)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field name, using Fields.field(String) for lookup.

      The Converter that is provided by Configuration.converterProvider() will be used to convert the value to U

      Specified by:
      get in interface Record
      Type Parameters:
      T - The conversion type parameter
      Parameters:
      fieldName - The field's name
      type - The conversion type
      Returns:
      The value of a field's name contained in this record
    • get

      public final <U> U get(String fieldName, Converter<?,? extends U> converter)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field name, using Fields.field(String) for lookup.
      Specified by:
      get in interface Record
      Type Parameters:
      U - The conversion type parameter
      Parameters:
      fieldName - The field's name
      converter - The data type converter
      Returns:
      The value of a field's name contained in this record
    • get

      public final Object get(Name fieldName)
      Description copied from interface: Record
      Get a value from this Record, providing a field name, using Fields.field(Name) for lookup.
      Specified by:
      get in interface Record
      Parameters:
      fieldName - The field's name
      Returns:
      The value of a field's name contained in this record
    • get

      public final <T> T get(Name fieldName, Class<? extends T> type)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field name, using Fields.field(Name) for lookup.

      The Converter that is provided by Configuration.converterProvider() will be used to convert the value to U

      Specified by:
      get in interface Record
      Type Parameters:
      T - The conversion type parameter
      Parameters:
      fieldName - The field's name
      type - The conversion type
      Returns:
      The value of a field's name contained in this record
    • get

      public final <U> U get(Name fieldName, Converter<?,? extends U> converter)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field name, using Fields.field(Name) for lookup.
      Specified by:
      get in interface Record
      Type Parameters:
      U - The conversion type parameter
      Parameters:
      fieldName - The field's name
      converter - The data type converter
      Returns:
      The value of a field's name contained in this record
    • setValue

      @Deprecated protected final void setValue(int index, Object value)
      Deprecated.
      - Use AbstractRecord.set(int, Object) instead
      Subclasses may type-unsafely set a value to a record index. This method takes care of converting the value to the appropriate type.
    • set

      protected final void set(int index, Object value)
    • set

      public final <T> void set(Field<T> field, T value)
      Description copied from interface: Record
      Set a value into this record, using Fields.field(Field) for lookup.

      This will always set the Record.changed(Field) flag for the given field, no matter if setting the value actually changes the value.

      Changing Table.getPrimaryKey() values will set all Record.changed() flags to true, in order to produce complete INSERT statements on subsequent UpdatableRecord.store() operations.

      Specified by:
      set in interface Record
      Type Parameters:
      T - The generic field parameter
      Parameters:
      field - The field
      value - The value
    • set

      public final <T, U> void set(Field<T> field, U value, Converter<? extends T,? super U> converter)
      Description copied from interface: Record
      Set a value into this record, using Fields.field(Field) for lookup.

      This will always set the Record.changed(Field) flag for the given field, no matter if setting the value actually changes the value.

      Changing Table.getPrimaryKey() values will set all Record.changed() flags to true, in order to produce complete INSERT statements on subsequent UpdatableRecord.store() operations.

      Specified by:
      set in interface Record
      Type Parameters:
      T - The generic field parameter
      U - The conversion type parameter
      Parameters:
      field - The field
      value - The value
      converter - The converter used to convert value into an appropriate type
    • original

      public final <T> T original(Field<T> field)
      Description copied from interface: Record
      Get an original value from this record as fetched from the database, using Fields.field(Field) for lookup.

      Record values can be freely modified after having fetched a record from the database. Every record also references the originally fetched values. This method returns such an original value for a field.

      Specified by:
      original in interface Record
      See Also:
    • original

      public final Object original(int fieldIndex)
      Description copied from interface: Record
      Get an original value from this record as fetched from the database.

      Record values can be freely modified after having fetched a record from the database. Every record also references the originally fetched values. This method returns such an original value for a field.

      Specified by:
      original in interface Record
      Parameters:
      fieldIndex - The 0-based field index in this record.
      See Also:
    • original

      public final Object original(String fieldName)
      Description copied from interface: Record
      Get an original value from this record as fetched from the database, using Fields.field(String) for lookup.

      Record values can be freely modified after having fetched a record from the database. Every record also references the originally fetched values. This method returns such an original value for a field.

      Specified by:
      original in interface Record
      See Also:
    • original

      public final Object original(Name fieldName)
      Description copied from interface: Record
      Get an original value from this record as fetched from the database, using Fields.field(Name) for lookup.

      Record values can be freely modified after having fetched a record from the database. Every record also references the originally fetched values. This method returns such an original value for a field.

      Specified by:
      original in interface Record
      See Also:
    • changed

      public final boolean changed()
      Description copied from interface: Record
      Check if this record has been changed from its original as fetched from the database.

      If this returns false, then it can be said that record.equals(record.original()) is true.

      Specified by:
      changed in interface Record
      See Also:
    • changed

      public final boolean changed(Field<?> field)
      Description copied from interface: Record
      Check if a field's value has been changed from its original as fetched from the database, using Fields.field(Field) for lookup.
      Specified by:
      changed in interface Record
      See Also:
    • changed

      public final boolean changed(int fieldIndex)
      Description copied from interface: Record
      Check if a field's value has been changed from its original as fetched from the database.
      Specified by:
      changed in interface Record
      Parameters:
      fieldIndex - The 0-based field index in this record.
      See Also:
    • changed

      public final boolean changed(String fieldName)
      Description copied from interface: Record
      Check if a field's value has been changed from its original as fetched from the database, using Fields.field(String) for lookup.
      Specified by:
      changed in interface Record
      See Also:
    • changed

      public final boolean changed(Name fieldName)
      Description copied from interface: Record
      Check if a field's value has been changed from its original as fetched from the database, using Fields.field(Name) for lookup.
      Specified by:
      changed in interface Record
      See Also:
    • changed

      public final void changed(boolean c)
      Description copied from interface: Record
      Set all of this record's internal changed flags to the supplied value.

      If the changed argument is false, the Record.original() values will be reset to the corresponding "current" values as well

      Specified by:
      changed in interface Record
      See Also:
    • changed

      public final void changed(Field<?> field, boolean c)
      Description copied from interface: Record
      Set this record's internal changed flag to the supplied value for a given field, using Fields.field(Field) for lookup.

      If the changed argument is false, the Record.original(Field) value will be reset to the corresponding "current" value as well

      Specified by:
      changed in interface Record
      See Also:
    • changed

      public final void changed(int fieldIndex, boolean c)
      Description copied from interface: Record
      Set this record's internal changed flag to the supplied value for a given field.

      If the changed argument is false, the Record.original(int) value will be reset to the corresponding "current" value as well

      Specified by:
      changed in interface Record
      Parameters:
      fieldIndex - The 0-based field index in this record.
      See Also:
    • changed

      public final void changed(String fieldName, boolean c)
      Description copied from interface: Record
      Set this record's internal changed flag to the supplied value for a given field, using Fields.field(String) for lookup.

      If the changed argument is false, the Record.original(String) value will be reset to the corresponding "current" value as well

      Specified by:
      changed in interface Record
      See Also:
    • changed

      public final void changed(Name fieldName, boolean c)
      Description copied from interface: Record
      Set this record's internal changed flag to the supplied value for a given field, using Fields.field(Name) for lookup.

      If the changed argument is false, the Record.original(Name) value will be reset to the corresponding "current" value as well

      Specified by:
      changed in interface Record
      See Also:
    • reset

      public final void reset()
      Description copied from interface: Record
      Reset all values to their Record.original() values and all Record.changed() flags to false.
      Specified by:
      reset in interface Record
    • reset

      public final void reset(Field<?> field)
      Description copied from interface: Record
      Reset a given value to its Record.original(Field) value and its Record.changed(Field) flag to false, using Fields.field(Field) for lookup.
      Specified by:
      reset in interface Record
    • reset

      public final void reset(int fieldIndex)
      Description copied from interface: Record
      Reset a given value to its Record.original(int) value and its Record.changed(int) flag to false.
      Specified by:
      reset in interface Record
      Parameters:
      fieldIndex - The 0-based field index in this record.
    • reset

      public final void reset(String fieldName)
      Description copied from interface: Record
      Reset a given value to its Record.original(String) value and its Record.changed(String) flag to false, using Fields.field(String) for lookup.
      Specified by:
      reset in interface Record
    • reset

      public final void reset(Name fieldName)
      Description copied from interface: Record
      Reset a given value to its Record.original(Name) value and its Record.changed(Name) flag to false, using Fields.field(Name) for lookup.
      Specified by:
      reset in interface Record
    • intoArray

      public final Object[] intoArray()
      Description copied from interface: Record
      Convert this record into an array.

      The resulting array has the same number of elements as this record has fields. The resulting array contains data as such:

       
       // For arbitrary values of i
       record.getValue(i) == record.intoArray()[i]
       
       

      This is the same as calling into(Object[].class)

      Specified by:
      intoArray in interface Record
      Returns:
      This record as an array
      See Also:
    • intoList

      public final List<Object> intoList()
      Description copied from interface: Record
      Convert this record into a list.

      The resulting list has the same number of elements as this record has fields. The resulting array contains data as such:

       
       // For arbitrary values of i
       record.getValue(i) == record.intoList().get(i)
       
       

      This is the same as calling Arrays.asList(intoArray())

      Specified by:
      intoList in interface Record
    • intoStream

      public final Stream<Object> intoStream()
      Description copied from interface: Record
      Convert this record into a stream.

      The resulting stream has the same number of elements as this record has fields. The resulting stream contains data as such:

      This is the same as calling into(Stream.class)

      Specified by:
      intoStream in interface Record
      Returns:
      This record as a stream
    • intoMap

      public final Map<String,Object> intoMap()
      Description copied from interface: Record
      Return this record as a name/value map.

      This is the inverse operation to Record.fromMap(Map)

      Specified by:
      intoMap in interface Record
      Returns:
      This record as a map
      See Also:
    • into

      public final Record into(Field<?>... f)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Parameters:
      f - The fields of the new record
      Returns:
      The new record
    • into

      public final <T1> Record1<T1> into(Field<T1> field1)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2> Record2<T1,T2> into(Field<T1> field1, Field<T2> field2)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3> Record3<T1,T2,T3> into(Field<T1> field1, Field<T2> field2, Field<T3> field3)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4> Record4<T1,T2,T3,T4> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5> Record5<T1,T2,T3,T4,T5> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6> Record6<T1,T2,T3,T4,T5,T6> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7> Record7<T1,T2,T3,T4,T5,T6,T7> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8> Record8<T1,T2,T3,T4,T5,T6,T7,T8> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9> Record9<T1,T2,T3,T4,T5,T6,T7,T8,T9> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Record10<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Record11<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Record12<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Record13<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Record14<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Record15<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Record16<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> Record17<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Record18<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> Record19<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> Record20<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> Record21<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20, Field<T21> field21)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> Record22<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22> into(Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13, Field<T14> field14, Field<T15> field15, Field<T16> field16, Field<T17> field17, Field<T18> field18, Field<T19> field19, Field<T20> field20, Field<T21> field21, Field<T22> field22)
      Description copied from interface: Record
      Copy this record into a new record holding only a subset of the previous fields, using Fields.field(Field) for lookup.
      Specified by:
      into in interface Record
      Returns:
      The new record
      See Also:
    • into

      public final <E> E into(Class<? extends E> type)
      Description copied from interface: Record
      Map resulting records onto a custom type.

      This will map this record onto your custom type using a RecordMapper as provided by Configuration.recordMapperProvider(). If no custom provider is specified, the DefaultRecordMapperProvider is used.

      Specified by:
      into in interface Record
      Type Parameters:
      E - The generic entity type.
      Parameters:
      type - The entity type.
      See Also:
    • into

      public <E> E into(E object)
      Description copied from interface: Record
      Map resulting records onto a custom type.

      This is the same as Record.into(Class), except that no new object is instantiated as a result. Instead, you can provide your own custom POJO instance.

      Specified by:
      into in interface Record
      Type Parameters:
      E - The generic entity type.
      Parameters:
      object - The receiving bean.
      See Also:
    • into

      public final <R extends Record> R into(Table<R> table)
      Description copied from interface: Record
      Map resulting records onto a custom record type.

      The mapping algorithm is this:

      jOOQ will map Record values by equal field names:

      • For every field in the table argument with Field.getName() "MY_field" (case-sensitive!), a corresponding field with the same name in this record will be searched.
      • If several fields in this record share the same Field.getName(), then the first one returning true on Field.equals(Object) will be returned. (e.g. qualified field names match)

      Other restrictions

      Specified by:
      into in interface Record
      Type Parameters:
      R - The generic table record type.
      Parameters:
      table - The table type.
    • intoResultSet

      public final ResultSet intoResultSet()
      Description copied from interface: Record
      Generate an in-memory JDBC ResultSet containing the data of this Record.

      Use this as an adapter for JDBC-compliant code that expects a ResultSet to operate on, rather than a jOOQ Result. The returned ResultSet allows for the following behaviour according to the JDBC specification:

      You may use DSLContext.fetch(ResultSet) to unwind this wrapper again.

      This is the same as creating a new Result with this Record only, and then calling Result.intoResultSet() on that Result

      Specified by:
      intoResultSet in interface Record
      Returns:
      A wrapper JDBC ResultSet
    • map

      public final <E> E map(RecordMapper<Record,E> mapper)
      Description copied from interface: Record
      Map this record into a custom mapper callback.
      Specified by:
      map in interface Record
      Parameters:
      mapper - The mapper callback
      Returns:
      The custom mapped record
    • from

      public final void from(Object source)
      Description copied from interface: Record
      Load data into this record from a source.

      The mapping algorithm is this:

      If source is an array

      Loading of data is delegated to Record.fromArray(Object...)

      If source is a Map

      Loading of data is delegated to Record.fromMap(Map)

      If source is an Iterable

      Loading of data is equivalent to loading Record.fromArray(Object...), transforming the Iterable to an array, first.

      If any JPA Column annotations are found on the Class of the provided source, only those are used. Matching candidates are:

      • Public no-argument instance methods annotated with Column
      • Public no-argument instance methods starting with getXXX or isXXX, if there exists a matching public single-argument setXXX() instance method that is annotated with Column
      • Public instance member fields annotated with Column
      Additional matching rules:
      • Column.name() must match Field.getName(). All other annotation attributes are ignored
      • Only the first match per field is used
      • Matching methods have a higher priority than matching member fields
      • Explicitly matching methods have a higher priority than implicitly matching methods (implicitly matching getter = setter is annotated)
      • Static methods / member fields are ignored

      If there are no JPA Column annotations, or jOOQ can't find the jakarta.persistence API on the classpath, jOOQ will map members by naming convention:

      If Field.getName() is MY_field (case-sensitive!), then this field's value will be fetched from the first of these:

      • Public no-argument instance method MY_field()
      • Public no-argument instance method myField()
      • Public no-argument instance method getMY_field()
      • Public no-argument instance method getMyField()
      • Public instance member field MY_field
      • Public instance member field myField

      Other restrictions

      • primitive types are supported.

      General notes

      The resulting record will have its internal "changed" flags set to true for all values. This means that UpdatableRecord.store() will perform an INSERT statement. If you wish to store the record using an UPDATE statement, use DSLContext.executeUpdate(UpdatableRecord) instead.

      This is the same as calling record.from(source, record.fields())

      Specified by:
      from in interface Record
      Parameters:
      source - The source object to copy data from
      See Also:
    • from

      public final void from(Object source, Field<?>... f)
      Description copied from interface: Record
      Load data into this record from a source, providing some fields, using Fields.field(Field) for lookup.

      This is the same as Record.from(Object), except that only fields contained in the fields argument will be mapped.

      Specified by:
      from in interface Record
      Parameters:
      source - The source object to copy data from
      f - The record's fields to use for mapping
      See Also:
    • from

      public final void from(Object source, String... fieldNames)
      Description copied from interface: Record
      Load data into this record from a source, providing some field names, using Fields.field(String) for lookup.

      This is the same as Record.from(Object), except that only fields contained in the fieldNames argument will be mapped.

      Specified by:
      from in interface Record
      Parameters:
      source - The source object to copy data from
      fieldNames - The record's fields names to use for mapping
      See Also:
    • from

      public final void from(Object source, Name... fieldNames)
      Description copied from interface: Record
      Load data into this record from a source, providing some field names, using Fields.field(Name) for lookup.

      This is the same as Record.from(Object), except that only fields contained in the fieldNames argument will be mapped.

      Specified by:
      from in interface Record
      Parameters:
      source - The source object to copy data from
      fieldNames - The record's fields names to use for mapping
      See Also:
    • from

      public final void from(Object source, int... fieldIndexes)
      Description copied from interface: Record
      Load data into this record from a source, providing some field indexes.

      This is the same as Record.from(Object), except that only fields contained in the fieldIndexes argument will be mapped.

      Specified by:
      from in interface Record
      Parameters:
      source - The source object to copy data from
      fieldIndexes - The record's 0-based field indexes to use for mapping
      See Also:
    • fromMap

      public final void fromMap(Map<String,?> map)
      Description copied from interface: Record
      Load data from a map into this record, using Fields.field(String) for lookup.

      The argument map is expected to hold field-name / value pairs where field-names correspond to actual field names as provided by Fields.field(String). Missing fields will be left untouched. Excess fields will be ignored.

      This is the inverse operation to Record.intoMap(). This is the same as calling record.fromMap(map, record.fields())

      Specified by:
      fromMap in interface Record
      See Also:
    • fromMap

      public final void fromMap(Map<String,?> map, Field<?>... f)
      Description copied from interface: Record
      Load data from a map into this record, providing some fields, using Fields.field(Field) for lookup.

      The argument map is expected to hold field-name / value pairs where field-names correspond to actual field names as provided by Fields.field(String). Missing fields will be left untouched. Excess fields will be ignored.

      This is the same as Record.fromMap(Map), except that only fields contained in the fields argument will be mapped.

      Specified by:
      fromMap in interface Record
      See Also:
    • fromMap

      public final void fromMap(Map<String,?> map, String... fieldNames)
      Description copied from interface: Record
      Load data from a map into this record, providing some field names, using Fields.field(String) for lookup.

      The argument map is expected to hold field-name / value pairs where field-names correspond to actual field names as provided by Fields.field(String). Missing fields will be left untouched. Excess fields will be ignored.

      This is the same as Record.fromMap(Map), except that only fields contained in the fieldNames argument will be mapped.

      Specified by:
      fromMap in interface Record
      See Also:
    • fromMap

      public final void fromMap(Map<String,?> map, Name... fieldNames)
      Description copied from interface: Record
      Load data from a map into this record, providing some field names, using Fields.field(Name) for lookup.

      The argument map is expected to hold field-name / value pairs where field-names correspond to actual field names as provided by Fields.field(Name). Missing fields will be left untouched. Excess fields will be ignored.

      This is the same as Record.fromMap(Map), except that only fields contained in the fieldNames argument will be mapped.

      Specified by:
      fromMap in interface Record
      See Also:
    • fromMap

      public final void fromMap(Map<String,?> map, int... fieldIndexes)
      Description copied from interface: Record
      Load data from a map into this record, providing some field indexes.

      The argument map is expected to hold field-name / value pairs where field-names correspond to actual field names as provided by Fields.field(String). Missing fields will be left untouched. Excess fields will be ignored.

      This is the same as Record.fromMap(Map), except that only fields contained in the fieldIndexes argument will be mapped.

      Specified by:
      fromMap in interface Record
      fieldIndexes - The 0-based field indexes in this record.
      See Also:
    • fromArray

      public final void fromArray(Object... array)
      Description copied from interface: Record
      Load data from an array into this record.

      The argument array is expected to hold values for this record's field indexes. Missing values will be left untouched. Excess values will be ignored.

      This is the inverse operation to Record.intoArray()

      Specified by:
      fromArray in interface Record
      See Also:
    • fromArray

      public final void fromArray(Object[] array, Field<?>... f)
      Description copied from interface: Record
      Load data from an array into this record, providing some fields, using Fields.field(Field) for lookup.

      The argument array is expected to hold values for this record's field indexes. Missing values will be left untouched. Excess values will be ignored.

      This is the same as Record.fromArray(Object...), except that only fields contained in the fields argument will be mapped.

      Specified by:
      fromArray in interface Record
      See Also:
    • fromArray

      public final void fromArray(Object[] array, String... fieldNames)
      Description copied from interface: Record
      Load data from an array into this record, providing some fields names, using Fields.field(String) for lookup.

      The argument array is expected to hold values for this record's field indexes. Missing values will be left untouched. Excess values will be ignored.

      This is the same as Record.fromArray(Object...), except that only fields contained in the fieldNames argument will be mapped.

      Specified by:
      fromArray in interface Record
      See Also:
    • fromArray

      public final void fromArray(Object[] array, Name... fieldNames)
      Description copied from interface: Record
      Load data from an array into this record, providing some fields names, using Fields.field(Name) for lookup.

      The argument array is expected to hold values for this record's field indexes. Missing values will be left untouched. Excess values will be ignored.

      This is the same as Record.fromArray(Object...), except that only fields contained in the fieldNames argument will be mapped.

      Specified by:
      fromArray in interface Record
      See Also:
    • fromArray

      public final void fromArray(Object[] array, int... fieldIndexes)
      Description copied from interface: Record
      Load data from an array into this record, providing some fields indexes.

      The argument array is expected to hold values for this record's field indexes. Missing values will be left untouched. Excess values will be ignored.

      This is the same as Record.fromArray(Object...), except that only fields contained in the fieldIndexes argument will be mapped.

      Specified by:
      fromArray in interface Record
      fieldIndexes - The 0-based field indexes in this record.
      See Also:
    • from

      protected final void from(Record source)
      This method was implemented with [#799]. It may be useful to make it public for broader use...?
    • format

      public final void format(Writer writer, TXTFormat format)
      Description copied from interface: Formattable
      Like Formattable.format(TXTFormat), but the data is output onto a Writer.
      Specified by:
      format in interface Formattable
    • formatCSV

      public final void formatCSV(Writer writer, CSVFormat format)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(CSVFormat), but the data is output onto a Writer.
      Specified by:
      formatCSV in interface Formattable
    • formatJSON

      public final void formatJSON(Writer writer, JSONFormat format)
      Description copied from interface: Formattable
      Like Formattable.formatJSON(JSONFormat), but the data is output onto a Writer.
      Specified by:
      formatJSON in interface Formattable
    • formatXML

      public final void formatXML(Writer writer, XMLFormat format)
      Description copied from interface: Formattable
      Like Formattable.formatXML(XMLFormat), but the data is output onto a Writer.
      Specified by:
      formatXML in interface Formattable
    • formatHTML

      public final void formatHTML(Writer writer)
      Description copied from interface: Formattable
      Like Formattable.formatHTML(), but the data is output onto a Writer.
      Specified by:
      formatHTML in interface Formattable
    • formatChart

      public final void formatChart(Writer writer, ChartFormat format)
      Description copied from interface: Formattable
      Like Formattable.formatChart(ChartFormat), but the data is output onto a Writer.
      Specified by:
      formatChart in interface Formattable
    • formatInsert

      public final void formatInsert(Writer writer)
      Description copied from interface: Formattable
      Like Formattable.formatInsert(), but the data is output onto a Writer.
      Specified by:
      formatInsert in interface Formattable
    • formatInsert

      public final void formatInsert(Writer writer, Table<?> table, Field<?>... f)
      Description copied from interface: Formattable
      Like Formattable.formatInsert(Table, Field...), but the data is output onto an Writer.
      Specified by:
      formatInsert in interface Formattable
    • intoXML

      public final Document intoXML(XMLFormat format)
      Description copied from interface: Formattable
      Get this result as XML.
      Specified by:
      intoXML in interface Formattable
      See Also:
    • intoXML

      public final <H extends ContentHandler> H intoXML(H handler, XMLFormat format) throws SAXException
      Description copied from interface: Formattable
      Get this result as XML using a SAX ContentHandler.
      Specified by:
      intoXML in interface Formattable
      Parameters:
      handler - The custom content handler.
      Returns:
      The argument content handler is returned for convenience.
      Throws:
      SAXException
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(Record that)
      Description copied from interface: Record
      Compares this Record with another Record according to their natural ordering.

      jOOQ Records implement Comparable to allow for naturally ordering Records in a "SQL way", i.e. according to the following rules:

      Records being compared must have the same ROW type

      Two Records are comparable if and only if they have the same ROW type, i.e. if their fieldsRow() methods return fields of the same type and degree.

      Comparison rules

      Assume the following notations:

      • X[i] means X.getValue(i)
      • X = Y means X.compareTo(Y) == 0
      • X < Y means X.compareTo(Y) < 0
      • X[i] = Y[i] means (X[i] == null && Y[i] == null) || X[i].compareTo(Y[i]) == 0
      • X[i] < Y[i] means Y[i] == null || X[i].compareTo(Y[i]) < 0. This corresponds to the SQL NULLS LAST clause.
      Then, for two comparable Records r1 and r2, x = r1.compareTo(r2) yields:
      • x = -1: if
         
            (r1[0] < r2[0])
         OR (r1[0] = r2[0] AND r1[1] < r2[1])
         OR  ...
         OR (r1[0] = r2[0] AND ... AND r1[N-1] = r2[N-1] AND r1[N] < r2[N])
         
      • x = 0: if
         
         OR (r1[0] = r2[0] AND ... AND r1[N-1] = r2[N-1] AND r1[N] = r2[N])
         
      • x = 1: if
         
            (r1[0] > r2[0])
         OR (r1[0] = r2[0] AND r1[1] > r2[1])
         OR  ...
         OR (r1[0] = r2[0] AND ... AND r1[N-1] = r2[N-1] AND r1[N] > r2[N])
         

      Note, that the above rules correspond to the SQL ordering behaviour as illustrated in the following examples:

       
       -- A SQL ORDER BY clause, ordering all records by columns in their order
       SELECT a, b, c
       FROM my_table
       ORDER BY 1, 2, 3
      
       -- A row value expression comparison predicate
       SELECT *
       FROM my_table
       WHERE (a, b, c) < (1, 2, 3)
       
       

      See Row1.lessThan(Row1), Row2.lessThan(Row2), ..., Row22.lessThan(Row22) for more details about row value expression comparison predicates

      Alternative sorting behaviour can be achieved through Result.sortAsc(java.util.Comparator) and similar methods.

      Specified by:
      compareTo in interface Comparable<Record>
      Specified by:
      compareTo in interface Record
    • getValue

      public final <T> T getValue(Field<T> field)
      Description copied from interface: Record
      Get a value from this Record, providing a field, using Fields.field(Field) for lookup.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.get(Field) instead.

      Specified by:
      getValue in interface Record
      See Also:
    • getValue

      public final <T> T getValue(Field<?> field, Class<? extends T> type)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field, using Fields.field(Field) for lookup.

      [#2211] Future versions of jOOQ might remove tthis method. It is recommended to use Record.get(Field, Class) instead.

      Specified by:
      getValue in interface Record
      See Also:
    • getValue

      public final <T, U> U getValue(Field<T> field, Converter<? super T,? extends U> converter)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field, using Fields.field(Field) for lookup.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.get(Field, Converter) instead.

      Specified by:
      getValue in interface Record
      See Also:
    • getValue

      public final Object getValue(int index)
      Description copied from interface: Record
      Get a value from this record, providing a field index.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.get(int) instead.

      Specified by:
      getValue in interface Record
      Parameters:
      index - The 0-based field index in this record.
      See Also:
    • getValue

      public final <T> T getValue(int index, Class<? extends T> type)
      Description copied from interface: Record
      Get a converted value from this record, providing a field index.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.get(int, Class) instead.

      Specified by:
      getValue in interface Record
      Parameters:
      index - The 0-based field index in this record.
      See Also:
    • getValue

      public final <U> U getValue(int index, Converter<?,? extends U> converter)
      Description copied from interface: Record
      Get a converted value from this record, providing a field index.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.get(int, Converter) instead.

      Specified by:
      getValue in interface Record
      Parameters:
      index - The 0-based field index in this record.
      See Also:
    • getValue

      public final Object getValue(String fieldName)
      Description copied from interface: Record
      Get a value from this Record, providing a field name, using Fields.field(String) for lookup.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.get(String) instead.

      Specified by:
      getValue in interface Record
      See Also:
    • getValue

      public final <T> T getValue(String fieldName, Class<? extends T> type)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field name, using Fields.field(String) for lookup.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.get(String, Class) instead.

      Specified by:
      getValue in interface Record
      See Also:
    • getValue

      public final <U> U getValue(String fieldName, Converter<?,? extends U> converter)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field name, using Fields.field(String) for lookup.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.get(String, Converter) instead.

      Specified by:
      getValue in interface Record
      See Also:
    • getValue

      public final Object getValue(Name fieldName)
      Description copied from interface: Record
      Get a value from this Record, providing a field name, using Fields.field(Name) for lookup.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.get(Name) instead.

      Specified by:
      getValue in interface Record
      See Also:
    • getValue

      public final <T> T getValue(Name fieldName, Class<? extends T> type)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field name, using Fields.field(Name) for lookup.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.get(Name, Class) instead.

      Specified by:
      getValue in interface Record
      See Also:
    • getValue

      public final <U> U getValue(Name fieldName, Converter<?,? extends U> converter)
      Description copied from interface: Record
      Get a converted value from this Record, providing a field name, using Fields.field(Name) for lookup.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.get(Name, Converter) instead.

      Specified by:
      getValue in interface Record
      See Also:
    • setValue

      public final <T> void setValue(Field<T> field, T value)
      Description copied from interface: Record
      Set a value into this record, using Fields.field(Field) for lookup.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.set(Field, Object) instead.

      Specified by:
      setValue in interface Record
      See Also:
    • setValue

      public final <T, U> void setValue(Field<T> field, U value, Converter<? extends T,? super U> converter)
      Description copied from interface: Record
      Set a value into this record, using Fields.field(Field) for lookup.

      [#2211] Future versions of jOOQ might remove this method. It is recommended to use Record.set(Field, Object, Converter) instead.

      Specified by:
      setValue in interface Record
      See Also:
    • create

      @Deprecated protected final DSLContext create()
      Deprecated.
      - 3.11.0 - [#6720] [#6721] - Use Attachable.configuration() and Configuration.dsl() instead.
      This method is used in generated code!
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • attach

      public final void attach(Configuration c)
      Description copied from interface: Attachable
      Attach this object to a new Configuration.
      Specified by:
      attach in interface Attachable
      Parameters:
      c - A configuration or null, if you wish to detach this Attachable from its previous configuration.
    • detach

      public final void detach()
      Description copied from interface: Attachable
      Detach this object from its current Configuration.

      This is the same as calling attach(null).

      Specified by:
      detach in interface Attachable
    • configuration

      public final Configuration configuration()
      Description copied from interface: Attachable
      Get the currently attached Configuration, or null if no Configuration is attached.
      Specified by:
      configuration in interface Attachable
    • format

      public final String format()
      Description copied from interface: Formattable
      Get a simple formatted representation of this result.

      This is the same as calling Formattable.format(int) with maxRows = Integer.MAX_VALUE

      Specified by:
      format in interface Formattable
      Returns:
      The formatted result
    • format

      public final String format(int maxRecords)
      Description copied from interface: Formattable
      Get a simple formatted representation of this result.
      Specified by:
      format in interface Formattable
      Parameters:
      maxRecords - The maximum number of records to include in the formatted result
      Returns:
      The formatted result
    • format

      public final String format(TXTFormat format)
      Description copied from interface: Formattable
      Get a simple formatted representation of this result.
      Specified by:
      format in interface Formattable
      Parameters:
      format - The formatting information
      Returns:
      The formatted result
    • format

      public final void format(OutputStream stream)
      Description copied from interface: Formattable
      Like Formattable.format(), but the data is output onto an OutputStream.
      Specified by:
      format in interface Formattable
    • format

      public final void format(OutputStream stream, int maxRecords)
      Description copied from interface: Formattable
      Like Formattable.format(int), but the data is output onto an OutputStream.
      Specified by:
      format in interface Formattable
    • format

      public final void format(OutputStream stream, TXTFormat format)
      Description copied from interface: Formattable
      Like Formattable.format(TXTFormat), but the data is output onto an OutputStream.
      Specified by:
      format in interface Formattable
    • format

      public final void format(Writer writer)
      Description copied from interface: Formattable
      Like Formattable.format(), but the data is output onto a Writer.
      Specified by:
      format in interface Formattable
    • format

      public final void format(Writer writer, int maxRecords)
      Description copied from interface: Formattable
      Like Formattable.format(int), but the data is output onto a Writer.
      Specified by:
      format in interface Formattable
    • formatCSV

      public final String formatCSV()
      Description copied from interface: Formattable
      Get a simple formatted representation of this result as CSV.

      This is the same as calling formatCSV(true, ',', "")

      Specified by:
      formatCSV in interface Formattable
      Returns:
      The formatted result
    • formatCSV

      public final String formatCSV(boolean header)
      Description copied from interface: Formattable
      Get a simple formatted representation of this result as CSV.

      This is the same as calling formatCSV(',', "")

      Specified by:
      formatCSV in interface Formattable
      Parameters:
      header - Whether to emit a CSV header line
      Returns:
      The formatted result
    • formatCSV

      public final String formatCSV(char delimiter)
      Description copied from interface: Formattable
      Get a simple formatted representation of this result as CSV.

      This is the same as calling formatCSV(true, delimiter, "")

      Specified by:
      formatCSV in interface Formattable
      Parameters:
      delimiter - The delimiter to use between records
      Returns:
      The formatted result
    • formatCSV

      public final String formatCSV(boolean header, char delimiter)
      Description copied from interface: Formattable
      Get a simple formatted representation of this result as CSV.

      This is the same as calling formatCSV(delimiter, "")

      Specified by:
      formatCSV in interface Formattable
      Parameters:
      header - Whether to emit a CSV header line
      delimiter - The delimiter to use between records
      Returns:
      The formatted result
    • formatCSV

      public final String formatCSV(char delimiter, String nullString)
      Description copied from interface: Formattable
      Get a simple formatted representation of this result as CSV.

      This is the same as calling formatCSV(true, delimiter, nullString)

      Specified by:
      formatCSV in interface Formattable
      Parameters:
      delimiter - The delimiter to use between records
      nullString - A special string for encoding NULL values.
      Returns:
      The formatted result
    • formatCSV

      public final String formatCSV(boolean header, char delimiter, String nullString)
      Description copied from interface: Formattable
      Get a simple formatted representation of this result as CSV.
      Specified by:
      formatCSV in interface Formattable
      Parameters:
      header - Whether to emit a CSV header line
      delimiter - The delimiter to use between records
      nullString - A special string for encoding NULL values.
      Returns:
      The formatted result
    • formatCSV

      public final String formatCSV(CSVFormat format)
      Description copied from interface: Formattable
      Get a simple formatted representation of this result as CSV.
      Specified by:
      formatCSV in interface Formattable
      Returns:
      The formatted result
    • formatCSV

      public final void formatCSV(OutputStream stream)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(), but the data is output onto an OutputStream.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(OutputStream stream, boolean header)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(boolean), but the data is output onto an OutputStream.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(OutputStream stream, char delimiter)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(char), but the data is output onto an OutputStream.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(OutputStream stream, boolean header, char delimiter)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(boolean, char), but the data is output onto an OutputStream.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(OutputStream stream, char delimiter, String nullString)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(char, String), but the data is output onto an OutputStream.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(OutputStream stream, boolean header, char delimiter, String nullString)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(boolean, char, String), but the data is output onto an OutputStream.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(OutputStream stream, CSVFormat format)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(CSVFormat), but the data is output onto an OutputStream.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(Writer writer)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(), but the data is output onto a Writer.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(Writer writer, boolean header)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(boolean), but the data is output onto a Writer.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(Writer writer, char delimiter)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(char), but the data is output onto a Writer.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(Writer writer, boolean header, char delimiter)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(boolean, char), but the data is output onto a Writer.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(Writer writer, char delimiter, String nullString)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(char, String), but the data is output onto a Writer.
      Specified by:
      formatCSV in interface Formattable
    • formatCSV

      public final void formatCSV(Writer writer, boolean header, char delimiter, String nullString)
      Description copied from interface: Formattable
      Like Formattable.formatCSV(boolean, char, String), but the data is output onto a Writer.
      Specified by:
      formatCSV in interface Formattable
    • formatJSON

      public final String formatJSON()
      Description copied from interface: Formattable
      Get a simple formatted representation of this result as a JSON array of array.

      The format is the following:

      
       {"fields":[{"name":"field-1","type":"type-1"},
                  {"name":"field-2","type":"type-2"},
                  ...,
                  {"name":"field-n","type":"type-n"}],
        "records":[[value-1-1,value-1-2,...,value-1-n],
                   [value-2-1,value-2-2,...,value-2-n]]}
       
      Specified by:
      formatJSON in interface Formattable
      Returns:
      The formatted result
    • formatJSON

      public final String formatJSON(JSONFormat format)
      Description copied from interface: Formattable
      Get a simple formatted representation of this result as a JSON data structure, according to the format.
      Specified by:
      formatJSON in interface Formattable
      Returns:
      The formatted result
      See Also:
    • formatJSON

      public final void formatJSON(OutputStream stream)
      Description copied from interface: Formattable
      Like Formattable.formatJSON(), but the data is output onto an OutputStream.
      Specified by:
      formatJSON in interface Formattable
    • formatJSON

      public final void formatJSON(OutputStream stream, JSONFormat format)
      Description copied from interface: Formattable
      Like Formattable.formatJSON(JSONFormat), but the data is output onto an OutputStream.
      Specified by:
      formatJSON in interface Formattable
    • formatJSON

      public final void formatJSON(Writer writer)
      Description copied from interface: Formattable
      Like Formattable.formatJSON(), but the data is output onto a Writer.
      Specified by:
      formatJSON in interface Formattable
    • formatXML

      public final String formatXML()
      Description copied from interface: Formattable
      Get this result formatted as XML.
      Specified by:
      formatXML in interface Formattable
      See Also:
    • formatXML

      public final String formatXML(XMLFormat format)
      Description copied from interface: Formattable
      Get this result formatted as XML.
      Specified by:
      formatXML in interface Formattable
      See Also:
    • formatXML

      public final void formatXML(OutputStream stream)
      Description copied from interface: Formattable
      Like Formattable.formatXML(), but the data is output onto an OutputStream.
      Specified by:
      formatXML in interface Formattable
    • formatXML

      public final void formatXML(OutputStream stream, XMLFormat format)
      Description copied from interface: Formattable
      Like Formattable.formatXML(XMLFormat), but the data is output onto an OutputStream.
      Specified by:
      formatXML in interface Formattable
    • formatXML

      public final void formatXML(Writer writer)
      Description copied from interface: Formattable
      Like Formattable.formatXML(), but the data is output onto a Writer.
      Specified by:
      formatXML in interface Formattable
    • formatChart

      public final String formatChart()
      Description copied from interface: Formattable
      Get this result as an ASCII chart.
      Specified by:
      formatChart in interface Formattable
      See Also:
    • formatChart

      public final String formatChart(ChartFormat format)
      Description copied from interface: Formattable
      Get this result as an ASCII chart.

      When running a query like this:

      
       String chart =
       create.select(
                  BOOK_TO_BOOK_STORE.BOOK_STORE_NAME,
                  count(BOOK_TO_BOOK_STORE.BOOK_ID).as("books")
              )
              .from(BOOK_TO_BOOK_STORE)
              .groupBy(BOOK_TO_BOOK_STORE.BOOK_STORE_NAME)
              .fetch()
              .formatChart();
       
      Where the formatted result would look like this:
       +-------------------------+-----+
       |BOOK_STORE_NAME          |books|
       +-------------------------+-----+
       |Buchhandlung im Volkshaus|    1|
       |Ex Libris                |    2|
       |Orell Füssli             |    3|
       +-------------------------+-----+
       
      Then the chart might look something like this:
       3.00|                                                  █████████████████████████
       2.91|                                                  █████████████████████████
       2.82|                                                  █████████████████████████
       2.73|                                                  █████████████████████████
       2.64|                                                  █████████████████████████
       2.55|                                                  █████████████████████████
       2.45|                                                  █████████████████████████
       2.36|                                                  █████████████████████████
       2.27|                                                  █████████████████████████
       2.18|                                                  █████████████████████████
       2.09|                                                  █████████████████████████
       2.00|                         ██████████████████████████████████████████████████
       1.91|                         ██████████████████████████████████████████████████
       1.82|                         ██████████████████████████████████████████████████
       1.73|                         ██████████████████████████████████████████████████
       1.64|                         ██████████████████████████████████████████████████
       1.55|                         ██████████████████████████████████████████████████
       1.45|                         ██████████████████████████████████████████████████
       1.36|                         ██████████████████████████████████████████████████
       1.27|                         ██████████████████████████████████████████████████
       1.18|                         ██████████████████████████████████████████████████
       1.09|                         ██████████████████████████████████████████████████
       1.00|███████████████████████████████████████████████████████████████████████████
       ----+---------------------------------------------------------------------------
           | Buchhandlung im Volkshaus         Ex Libris               Orell Füssli
       
      It is possible to specify a variety of ChartFormat formatting specifications, such as the width, height, display type (default, stacked, 100% stacked), the column index of the category and value columns, etc.
      Specified by:
      formatChart in interface Formattable
      See Also:
    • formatChart

      public final void formatChart(OutputStream stream)
      Description copied from interface: Formattable
      Like Formattable.formatChart(), but the data is output onto an OutputStream.
      Specified by:
      formatChart in interface Formattable
    • formatChart

      public final void formatChart(OutputStream stream, ChartFormat format)
      Description copied from interface: Formattable
      Like Formattable.formatChart(ChartFormat), but the data is output onto an OutputStream.
      Specified by:
      formatChart in interface Formattable
    • formatChart

      public final void formatChart(Writer writer)
      Description copied from interface: Formattable
      Like Formattable.formatChart(), but the data is output onto a Writer.
      Specified by:
      formatChart in interface Formattable
    • formatInsert

      public final String formatInsert()
      Description copied from interface: Formattable
      Get this result as a set of INSERT statements.

      This uses the the first record's TableRecord.getTable(), if the first record is a TableRecord. Otherwise, this generates INSERT statements into an "UNKNOWN_TABLE". In both cases, the Fields.fields() are used for column names.

      Specified by:
      formatInsert in interface Formattable
    • formatInsert

      public final void formatInsert(OutputStream stream)
      Description copied from interface: Formattable
      Like Formattable.formatInsert(), but the data is output onto an OutputStream.
      Specified by:
      formatInsert in interface Formattable
    • formatInsert

      public final String formatInsert(Table<?> table, Field<?>... f)
      Description copied from interface: Formattable
      Get this result as a set of INSERT statements.

      This explicitly specifies the table (and optionally the fields) to insert into. If the fields argument is left empty, the Fields.fields() are used, instead.

      Specified by:
      formatInsert in interface Formattable
    • formatInsert

      public final void formatInsert(OutputStream stream, Table<?> table, Field<?>... f)
      Description copied from interface: Formattable
      Like Formattable.formatInsert(Table, Field...), but the data is output onto an OutputStream.
      Specified by:
      formatInsert in interface Formattable
    • formatHTML

      public final String formatHTML()
      Description copied from interface: Formattable
      Get a simple formatted representation of this result as HTML.

      The HTML code is formatted as follows:

      
       <table>
         <thead>
           <tr>
             <th>field-1</th>
             <th>field-2</th>
             ...
             <th>field-n</th>
           </tr>
         </thead>
         <tbody>
           <tr>
             <th>value-1-1</th>
             <th>value-1-2</th>
             ...
             <th>value-1-n</th>
           </tr>
           <tr>
             <th>value-2-1</th>
             <th>value-2-2</th>
             ...
             <th>value-2-n</th>
           </tr>
           ...
         </tbody>
       </table>
       
      Specified by:
      formatHTML in interface Formattable
      Returns:
      The formatted result
    • formatHTML

      public final void formatHTML(OutputStream stream)
      Description copied from interface: Formattable
      Like Formattable.formatHTML(), but the data is output onto an OutputStream.
      Specified by:
      formatHTML in interface Formattable
    • intoXML

      public final Document intoXML()
      Description copied from interface: Formattable
      Get this result as XML.
      Specified by:
      intoXML in interface Formattable
      See Also:
    • intoXML

      public final <H extends ContentHandler> H intoXML(H handler) throws SAXException
      Description copied from interface: Formattable
      Get this result as XML using a SAX ContentHandler.
      Specified by:
      intoXML in interface Formattable
      Parameters:
      handler - The custom content handler.
      Returns:
      The argument content handler is returned for convenience.
      Throws:
      SAXException
      See Also: