Module org.jooq
Package org.jooq

Interface RecordType<R extends Record>


  • public interface RecordType<R extends Record>
    A record type for Table, Cursor, Result and other objects.

    This type differs from Row in several ways:

    • It is generic using <R>
    • It is not repeated for degrees 1 to 22, such as Row1 .. RowN
    • It is not part of the DSL
    Author:
    Lukas Eder
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @Nullable DataType<?> dataType​(int fieldIndex)
      Get the data type for a given field index.
      @Nullable DataType<?> dataType​(String fieldName)
      Get the data type for a given field name.
      @Nullable DataType<?> dataType​(Name fieldName)
      Get the data type for a given field name.
      @NotNull DataType<?>[] dataTypes()
      Get an array of data types for this record type.
      @Nullable Field<?> field​(int fieldIndex)
      Get a specific field from this record type.
      <T> @Nullable Field<T> field​(int fieldIndex, Class<T> type)
      Get a specific field from this record type coerced to type.
      <T> @Nullable Field<T> field​(int fieldIndex, DataType<T> dataType)
      Get a specific field from this record type coerced to dataType.
      @Nullable Field<?> field​(String fieldName)
      Get a specific field from this record type.
      <T> @Nullable Field<T> field​(String fieldName, Class<T> type)
      Get a specific field from this record type coerced to type.
      <T> @Nullable Field<T> field​(String fieldName, DataType<T> dataType)
      Get a specific field from this record type coerced to dataType.
      <T> @Nullable Field<T> field​(Field<T> field)
      Get a specific field from this record type.
      @Nullable Field<?> field​(Name fieldName)
      Get a specific qualified field from this record type.
      <T> @Nullable Field<T> field​(Name fieldName, Class<T> type)
      Get a specific field from this record type coerced to type.
      <T> @Nullable Field<T> field​(Name fieldName, DataType<T> dataType)
      Get a specific field from this record type coerced to dataType.
      @NotNull Field<?>[] fields()
      Get all fields from this record type.
      @NotNull Field<?>[] fields​(int... fieldIndexes)
      Get all fields from this record type, providing some field indexes.
      @NotNull Field<?>[] fields​(String... fieldNames)
      Get all fields from this record type, providing some field names.
      @NotNull Field<?>[] fields​(Field<?>... fields)
      Get all fields from this record type, providing some fields.
      @NotNull Field<?>[] fields​(Name... fieldNames)
      Get all fields from this record type, providing some field names.
      int indexOf​(String fieldName)
      Get a field's index from this record type.
      int indexOf​(Field<?> field)
      Get a field's index from this record type.
      int indexOf​(Name fieldName)
      Get a field's index from this record type.
      int size()
      Get the degree of this record type.
      @Nullable Class<?> type​(int fieldIndex)
      Get the type for a given field index.
      @Nullable Class<?> type​(String fieldName)
      Get the type for a given field name.
      @Nullable Class<?> type​(Name fieldName)
      Get the type for a given field name.
      @NotNull Class<?>[] types()
      Get an array of types for this record type.
    • Method Detail

      • size

        int size()
        Get the degree of this record type.
      • field

        @Nullable
        <T> @Nullable Field<T> field​(Field<T> field)
        Get a specific field from this record type.

        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 name of the argument field.
        • null otherwise.
        If several fields have the same name, the first one is returned and a warning is logged.
        Type Parameters:
        T - The generic field type
        Parameters:
        field - The field to fetch
        Returns:
        The field itself or an aliased field
      • field

        @Nullable
        @Nullable Field<?> field​(String fieldName)
        Get a specific field from this record type.
        Parameters:
        fieldName - The field to fetch
        Returns:
        The field with the given name
      • field

        @Nullable
        <T> @Nullable Field<T> field​(String fieldName,
                                     Class<T> type)
        Get a specific field from this record type coerced to type.
        Parameters:
        fieldName - The field to fetch
        type - The type to coerce the resulting field to
        Returns:
        The field with the given name
      • field

        @Nullable
        <T> @Nullable Field<T> field​(String fieldName,
                                     DataType<T> dataType)
        Get a specific field from this record type coerced to dataType.
        Parameters:
        fieldName - The field to fetch
        dataType - The data type to coerce the resulting field to
        Returns:
        The field with the given name
      • field

        @Nullable
        @Nullable Field<?> field​(Name fieldName)
        Get a specific qualified field from this record type.
        Parameters:
        fieldName - The field to fetch
        Returns:
        The field with the given name
      • field

        @Nullable
        <T> @Nullable Field<T> field​(Name fieldName,
                                     Class<T> type)
        Get a specific field from this record type coerced to type.
        Parameters:
        fieldName - The field to fetch
        type - The type to coerce the resulting field to
        Returns:
        The field with the given name
      • field

        @Nullable
        <T> @Nullable Field<T> field​(Name fieldName,
                                     DataType<T> dataType)
        Get a specific field from this record type coerced to dataType.
        Parameters:
        fieldName - The field to fetch
        dataType - The data type to coerce the resulting field to
        Returns:
        The field with the given name
      • field

        @Nullable
        @Nullable Field<?> field​(int fieldIndex)
        Get a specific field from this record type.
        Parameters:
        fieldIndex - The field's index of the field to fetch
        Returns:
        The field with the given name
      • field

        @Nullable
        <T> @Nullable Field<T> field​(int fieldIndex,
                                     Class<T> type)
        Get a specific field from this record type coerced to type.
        Parameters:
        fieldIndex - The field's index of the field to fetch
        type - The type to coerce the resulting field to
        Returns:
        The field with the given name
      • field

        @Nullable
        <T> @Nullable Field<T> field​(int fieldIndex,
                                     DataType<T> dataType)
        Get a specific field from this record type coerced to dataType.
        Parameters:
        fieldIndex - The field's index of the field to fetch
        dataType - The data type to coerce the resulting field to
        Returns:
        The field with the given name
      • fields

        @NotNull
        @NotNull Field<?>[] fields()
        Get all fields from this record type.
        Returns:
        All available fields
      • fields

        @NotNull
        @NotNull Field<?>[] fields​(Field<?>... fields)
        Get all fields from this record type, providing some fields.
        Returns:
        All available fields
        See Also:
        field(Field)
      • fields

        @NotNull
        @NotNull Field<?>[] fields​(String... fieldNames)
        Get all fields from this record type, providing some field names.
        Returns:
        All available fields
        See Also:
        field(String)
      • fields

        @NotNull
        @NotNull Field<?>[] fields​(Name... fieldNames)
        Get all fields from this record type, providing some field names.
        Returns:
        All available fields
        See Also:
        field(Name)
      • fields

        @NotNull
        @NotNull Field<?>[] fields​(int... fieldIndexes)
        Get all fields from this record type, providing some field indexes.
        Returns:
        All available fields
        See Also:
        field(int)
      • indexOf

        int indexOf​(Field<?> field)
        Get a field's index from this record type.
        Parameters:
        field - The field to look for
        Returns:
        The field's index or -1 if the field is not contained in this Row
      • indexOf

        int indexOf​(String fieldName)
        Get a field's index from this record type.
        Parameters:
        fieldName - The field name to look for
        Returns:
        The field's index or -1 if the field is not contained in this Row
      • indexOf

        int indexOf​(Name fieldName)
        Get a field's index from this record type.
        Parameters:
        fieldName - The field name to look for
        Returns:
        The field's index or -1 if the field is not contained in this Row
      • types

        @NotNull
        @NotNull Class<?>[] types()
        Get an array of types for this record type.

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

      • type

        @Nullable
        @Nullable Class<?> type​(int fieldIndex)
        Get the type for a given field index.
        Parameters:
        fieldIndex - The field's index of the field's type to fetch
        Returns:
        The field's type
      • type

        @Nullable
        @Nullable Class<?> type​(String fieldName)
        Get the type for a given field name.
        Parameters:
        fieldName - The field's name of the field's type to fetch
        Returns:
        The field's type
      • type

        @Nullable
        @Nullable Class<?> type​(Name fieldName)
        Get the type for a given field name.
        Parameters:
        fieldName - The field's name of the field's type to fetch
        Returns:
        The field's type
      • dataTypes

        @NotNull
        @NotNull DataType<?>[] dataTypes()
        Get an array of data types for this record type.

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

      • dataType

        @Nullable
        @Nullable DataType<?> dataType​(int fieldIndex)
        Get the data type for a given field index.
        Parameters:
        fieldIndex - The field's index of the field's data type to fetch
        Returns:
        The field's data type
      • dataType

        @Nullable
        @Nullable DataType<?> dataType​(String fieldName)
        Get the data type for a given field name.
        Parameters:
        fieldName - The field's name of the field's data type to fetch
        Returns:
        The field's data type
      • dataType

        @Nullable
        @Nullable DataType<?> dataType​(Name fieldName)
        Get the data type for a given field name.
        Parameters:
        fieldName - The field's name of the field's data type to fetch
        Returns:
        The field's data type