Table or a Record.
Fields may or may not be qualified. Independently of qualification, dialects may produce duplicate fields by name in top level queries, e.g.:
SELECT 1 AS id, 2 AS id, public.a.id
FROM public.a
In the above unfortunate example, there are 3 ambiguous ID
columns. Only one of them is qualified as A.ID, whereas the
other two are unqualified aliases that cannot be distinguished by name, only
by index. The behaviour of the various field access methods can be summarised
as follows:
field(int) will return the expected field by index and isn't
affected by this situation.field(String) (case sensitive) works only with unqualified field
names, and can thus not distinguish between any of the 3 fields. It will pick
the first match.field(Name) (case sensitive) works with unqualified or qualified
field names. Depending on whether qualification is available in the jOOQ
result (e.g. it might not be if you're using plain SQL templating, and the
JDBC driver isn't able to produce the qualification), the qualification
information will be used to disambiguate the result. Specifically:
field(Field) works like field(Name), except an
additional Field identity check will be used to disambiguate field
references. This is particularly useful when using generated code.Whenever an ambiguity is encountered, a warning is logged to help debug the case. Future jOOQ versions might throw an exception upon ambiguity.
Not all implementations actually know their fields. For example,
when using plain SQL templates (DSL#field(String)) or tables
constructed from identifiers (DSL#field(Name)), then the fields are
unknown to jOOQ and empty lists or arrays are returned, or null
is returned on single field returning methods.
| Modifier and Type | Method and Description |
|---|---|
| public @Nullable DataType | dataType(int
The field's 0-based index index)Get the field data type for a given field index, or |
| public @Nullable DataType | |
| public @Nullable DataType | |
| public @NotNull @NotNull DataType | |
| public <T> @Nullable Field | |
| public @Nullable Field | |
| public <T> @Nullable Field | |
| public <T> @Nullable Field | field(String
The unqualified name of the field name, DataType<T> The data type to coerce the resulting field to dataType)
Deprecated
as a consequence of
Get a field known to this type by unqualified name coerced to
Field being deprecated.
dataType, or null if no field is known to this
type by this name.
|
| public @Nullable Field | |
| public <T> @Nullable Field | |
| public <T> @Nullable Field | |
| public @Nullable Field | |
| public <T> @Nullable Field | |
| public <T> @Nullable Field | |
| public @NotNull @NotNull Field | |
| public @NotNull @Nullable Field | fields(Field<?>...
The fields to include after looking them up via
fields)field(Field).
Deprecated
as a consequence of
Get all fields, filtering by some fields.
Field being deprecated.
|
| public @NotNull @Nullable Field | fields(String...
The unqualified field names to include after looking them up
via names)field(String).
Deprecated
as a consequence of
Get all fields known to this type, filtering by some unqualified field
names.
Field being deprecated.
|
| public @NotNull @Nullable Field | fields(Name...
The qualified field names to include after looking them up
via names)field(Name).
Deprecated
as a consequence of
Get all fields known to this type, filtering by some qualified field
names.
Field being deprecated.
|
| public @NotNull @Nullable Field | fields(int...
The 0-based field indexes to include after looking them up
via indexes)field(int).
Deprecated
as a consequence of
Get all fields known to this type, filtering by some field indexes.
Field being deprecated.
|
| public @NotNull Row | |
| public @NotNull Stream | |
| public int | |
| public int | |
| public int | |
| public @Nullable Class | type(int
The field's 0-based index index)Get the field type for a given field index, or |
| public @Nullable Class | |
| public @Nullable Class | |
| public @NotNull @NotNull Class |
| dataType | back to summary |
|---|---|
| public @Nullable DataType Get the field data type for a given field index, or
| |
| dataType | back to summary |
|---|---|
| public @Nullable DataType Get the field data type for a given qualified field name, or
The lookup algorithm is the same as that of | |
| dataType | back to summary |
|---|---|
| public @Nullable DataType Get the field data type for a given qualified field name, or
The lookup algorithm is the same as that of | |
| dataTypes | back to summary |
|---|---|
| public @NotNull @NotNull DataType Get an array of field data types for this type.
Entries in the resulting array correspond to
| |
| field | back to summary |
|---|---|
| public <T> @Nullable Field Deprecated as a consequence of Get a field known to this type by field reference. This will return:
If several fields have the same ambiguous name, the first one is returned and a warning is logged.
| |
| field | back to summary |
|---|---|
| public @Nullable Field Deprecated as a consequence of Get a field known to this type by unqualified name, or If several fields have the same ambiguous name, the first one is returned and a warning is logged. | |
| field | back to summary |
|---|---|
| public <T> @Nullable Field Deprecated as a consequence of Get a field known to this type by unqualified name coerced to
If several fields have the same ambiguous name, the first one is returned and a warning is logged. | |
| field | back to summary |
|---|---|
| public <T> @Nullable Field Deprecated as a consequence of Get a field known to this type by unqualified name coerced to
If several fields have the same ambiguous name, the first one is returned and a warning is logged. | |
| field | back to summary |
|---|---|
| public @Nullable Field Deprecated as a consequence of Get a field known to this type by qualified name, or This will return:
If several fields have the same ambiguous name, the first one is returned and a warning is logged. | |
| field | back to summary |
|---|---|
| public <T> @Nullable Field Deprecated as a consequence of Get a field known to this type by qualified name coerced to
This will return:
If several fields have the same ambiguous name, the first one is returned and a warning is logged. | |
| field | back to summary |
|---|---|
| public <T> @Nullable Field Deprecated as a consequence of Get a field known to this type by qualified name coerced to
This will return:
If several fields have the same ambiguous name, the first one is returned and a warning is logged. | |
| field | back to summary |
|---|---|
| public @Nullable Field Deprecated as a consequence of Get a field known to this type by index, or
| |
| field | back to summary |
|---|---|
| public <T> @Nullable Field Deprecated as a consequence of Get a field known to this type by index coerced to | |
| field | back to summary |
|---|---|
| public <T> @Nullable Field Deprecated as a consequence of Get a field known to this type by index coerced to | |
| fields | back to summary |
|---|---|
| public @NotNull @NotNull Field Deprecated as a consequence of Get all fields known to this type.
| |
| fields | back to summary |
|---|---|
| public @NotNull @Nullable Field Deprecated as a consequence of Get all fields, filtering by some fields.
| |
| fields | back to summary |
|---|---|
| public @NotNull @Nullable Field Deprecated as a consequence of Get all fields known to this type, filtering by some unqualified field names.
| |
| fields | back to summary |
|---|---|
| public @NotNull @Nullable Field Deprecated as a consequence of Get all fields known to this type, filtering by some qualified field names.
| |
| fields | back to summary |
|---|---|
| public @NotNull @Nullable Field Deprecated as a consequence of Get all fields known to this type, filtering by some field indexes.
| |
| fieldsRow | back to summary |
|---|---|
| public @NotNull Row fieldsRow() Get all fields known to this type as a
| |
| fieldStream | back to summary |
|---|---|
| public @NotNull Stream Get all fields known to this type as a
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(Field<?> field)
Deprecated as a consequence of Get a field's index from this type.
The lookup algorithm is the same as that of
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(String name) Get a field's index from this type.
The lookup algorithm is the same as that of
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(Name name) Get a field's index from this type.
The lookup algorithm is the same as that of
| |
| type | back to summary |
|---|---|
| public @Nullable Class Get the field type for a given field index, or
| |
| type | back to summary |
|---|---|
| public @Nullable Class Get the field type for a given unqualified field name, or
The lookup algorithm is the same as that of | |
| type | back to summary |
|---|---|
| public @Nullable Class Get the field type for a given qualified field name, or
The lookup algorithm is the same as that of | |
| types | back to summary |
|---|---|
| public @NotNull @NotNull Class Get an array of field types for fields known to this type.
Entries in the resulting array correspond to
| |