- All Known Subinterfaces:
CloseableResultQuery<R>
,CommonTableExpression<R>
,Cursor<R>
,DeleteResultStep<R>
,EmbeddableRecord<R>
,InsertResultStep<R>
,JSONTableColumnPathStep
,JSONTableColumnsStep
,Path<R>
,QOM.CrossApply<R>
,QOM.CrossJoin<R>
,QOM.DataChangeDeltaTable<R>
,QOM.DeleteReturning<R>
,QOM.DerivedTable<R>
,QOM.Dual
,QOM.FullJoin<R>
,QOM.GenerateSeries<T>
,QOM.HintedTable<R>
,QOM.InsertReturning<R>
,QOM.Join<R>
,QOM.JoinTable<R,
,J> QOM.Lateral<R>
,QOM.LeftAntiJoin<R>
,QOM.LeftJoin<R>
,QOM.LeftSemiJoin<R>
,QOM.LinkedTable<R>
,QOM.NaturalFullJoin<R>
,QOM.NaturalJoin<R>
,QOM.NaturalLeftJoin<R>
,QOM.NaturalRightJoin<R>
,QOM.OuterApply<R>
,QOM.QualifiedJoin<R,
,J> QOM.RightJoin<R>
,QOM.RowsFrom
,QOM.RowSubquery
,QOM.StraightJoin<R>
,QOM.TableAlias<R>
,QOM.UpdateReturning<R>
,QOM.Values<R>
,QOM.WithOrdinalityTable<R>
,QOM.WithTable<R>
,QualifiedRecord<R>
,Record
,Record1<T1>
,Record10<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10> Record11<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Record12<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Record13<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Record14<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Record15<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Record16<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Record17<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> Record18<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Record19<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> Record2<T1,
,T2> Record20<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> Record21<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> Record22<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> Record3<T1,
,T2, T3> Record4<T1,
,T2, T3, T4> Record5<T1,
,T2, T3, T4, T5> Record6<T1,
,T2, T3, T4, T5, T6> Record7<T1,
,T2, T3, T4, T5, T6, T7> Record8<T1,
,T2, T3, T4, T5, T6, T7, T8> Record9<T1,
,T2, T3, T4, T5, T6, T7, T8, T9> RecordQualifier<R>
,RecordType<R>
,Result<R>
,ResultQuery<R>
,Row
,Row1<T1>
,Row10<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10> Row11<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Row12<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Row13<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Row14<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Row15<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Row16<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Row17<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> Row18<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> Row19<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> Row2<T1,
,T2> Row20<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> Row21<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> Row22<T1,
,T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> Row3<T1,
,T2, T3> Row4<T1,
,T2, T3, T4> Row5<T1,
,T2, T3, T4, T5> Row6<T1,
,T2, T3, T4, T5, T6> Row7<T1,
,T2, T3, T4, T5, T6, T7> Row8<T1,
,T2, T3, T4, T5, T6, T7, T8> Row9<T1,
,T2, T3, T4, T5, T6, T7, T8, T9> RowN
,Select<R>
,SelectConditionStep<R>
,SelectConnectByAfterStartWithConditionStep<R>
,SelectConnectByConditionStep<R>
,SelectConnectByStep<R>
,SelectCorrelatedSubqueryStep<R>
,SelectDistinctOnStep<R>
,SelectFinalStep<R>
,SelectForJSONCommonDirectivesStep<R>
,SelectForStep<R>
,SelectForUpdateOfStep<R>
,SelectForUpdateStep<R>
,SelectForUpdateWaitStep<R>
,SelectForXMLCommonDirectivesStep<R>
,SelectForXMLPathDirectivesStep<R>
,SelectForXMLRawDirectivesStep<R>
,SelectFromStep<R>
,SelectGroupByStep<R>
,SelectHavingConditionStep<R>
,SelectHavingStep<R>
,SelectIntoStep<R>
,SelectJoinStep<R>
,SelectLimitAfterOffsetStep<R>
,SelectLimitPercentAfterOffsetStep<R>
,SelectLimitPercentStep<R>
,SelectLimitStep<R>
,SelectOffsetStep<R>
,SelectOnConditionStep<R>
,SelectOptionalOnStep<R>
,SelectOptionStep<R>
,SelectOrderByStep<R>
,SelectQualifyConditionStep<R>
,SelectQualifyStep<R>
,SelectQuery<R>
,SelectSeekLimitStep<R>
,SelectSeekStep1<R,
,T1> SelectSeekStep10<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> SelectSeekStep11<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> SelectSeekStep12<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> SelectSeekStep13<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> SelectSeekStep14<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> SelectSeekStep15<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> SelectSeekStep16<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> SelectSeekStep17<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> SelectSeekStep18<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> SelectSeekStep19<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> SelectSeekStep2<R,
,T1, T2> SelectSeekStep20<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> SelectSeekStep21<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21> SelectSeekStep22<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> SelectSeekStep3<R,
,T1, T2, T3> SelectSeekStep4<R,
,T1, T2, T3, T4> SelectSeekStep5<R,
,T1, T2, T3, T4, T5> SelectSeekStep6<R,
,T1, T2, T3, T4, T5, T6> SelectSeekStep7<R,
,T1, T2, T3, T4, T5, T6, T7> SelectSeekStep8<R,
,T1, T2, T3, T4, T5, T6, T7, T8> SelectSeekStep9<R,
,T1, T2, T3, T4, T5, T6, T7, T8, T9> SelectSeekStepN<R>
,SelectSelectStep<R>
,SelectStartWithStep<R>
,SelectUnionStep<R>
,SelectWhereStep<R>
,SelectWindowStep<R>
,SelectWithTiesAfterOffsetStep<R>
,SelectWithTiesStep<R>
,Table<R>
,TableLike<R>
,TableOnConditionStep<R>
,TableOptionalOnStep<R>
,TableRecord<R>
,UDT<R>
,UDTRecord<R>
,UpdatableRecord<R>
,UpdateResultStep<R>
,XMLTableColumnPathStep
,XMLTableColumnsStep
- All Known Implementing Classes:
CustomRecord
,CustomTable
,DefaultBinding.SdoGeometryRecord
,DefaultBinding.SdoPointTypeRecord
,EmbeddableRecordImpl
,TableImpl
,TableRecordImpl
,UDTImpl
,UDTRecordImpl
,UpdatableRecordImpl
Table
or a Record
.
Ambiguities
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 likefield(Name)
, except an additionalField
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.
Unknown fields
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.
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescription@Nullable DataType
<?> dataType
(int index) Get the field data type for a given field index, ornull
if no field is available at the index.@Nullable DataType
<?> Get the field data type for a given qualified field name, ornull
if no field is known to this type by this name.@Nullable DataType
<?> Get the field data type for a given qualified field name, ornull
if no field is known to this type by this name.@NotNull DataType<?> @NotNull []
Get an array of field data types for this type.@Nullable Field
<?> field
(int index) Get a field known to this type by index, ornull
if no field is available at the index.<T> @Nullable Field
<T> Get a field known to this type by index coerced totype
usingField.coerce(Class)
, ornull
if no field is available at the index.<T> @Nullable Field
<T> Get a field known to this type by index coerced todataType
usingField.coerce(DataType)
, ornull
if no field is available at the index.@Nullable Field
<?> Get a field known to this type by unqualified name, ornull
if no field is known to this type by this name.<T> @Nullable Field
<T> Get a field known to this type by unqualified name coerced totype
usingField.coerce(Class)
, ornull
if no field is known to this type by this name.<T> @Nullable Field
<T> Get a field known to this type by unqualified name coerced todataType
usingField.coerce(DataType)
, ornull
if no field is known to this type by this name.<T> @Nullable Field
<T> Get a field known to this type by field reference.@Nullable Field
<?> Get a field known to this type by qualified name, ornull
if no field is known to this type by this name.<T> @Nullable Field
<T> Get a field known to this type by qualified name coerced totype
usingField.coerce(Class)
, ornull
if no field is known to this type by this name.<T> @Nullable Field
<T> Get a field known to this type by qualified name coerced todataType
usingField.coerce(DataType)
, ornull
if no field is known to this type by this name.@NotNull Field<?> @NotNull []
fields()
Get all fields known to this type.@Nullable Field<?> @NotNull []
fields
(int... indexes) Get all fields known to this type, filtering by some field indexes.@Nullable Field<?> @NotNull []
Get all fields known to this type, filtering by some unqualified field names.@Nullable Field<?> @NotNull []
Get all fields, filtering by some fields.@Nullable Field<?> @NotNull []
Get all fields known to this type, filtering by some qualified field names.@NotNull Fields
Get anotherFields
instance that includes the hidden fields.@NotNull Row
Get all fields known to this type as aRow
.Get all fields known to this type as aStream
.int
Get a field's index from this type.int
Get a field's index from this type.int
Get a field's index from this type.@Nullable Class
<?> type
(int index) Get the field type for a given field index, ornull
if no field is available at the index.@Nullable Class
<?> Get the field type for a given unqualified field name, ornull
if no field is known to this type by this name.@Nullable Class
<?> Get the field type for a given qualified field name, ornull
if no field is known to this type by this name.@NotNull Class<?> @NotNull []
types()
Get an array of field types for fields known to this type.
-
Method Details
-
fieldsIncludingHidden
Get anotherFields
instance that includes the hidden fields. -
fields
Get all fields known to this type. -
fieldsRow
Get all fields known to this type as aRow
. -
fieldStream
Get all fields known to this type as aStream
. -
field
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.
-
field
Get a field known to this type by unqualified name, ornull
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.
- Parameters:
name
- The unqualified name of the field
-
field
Get a field known to this type by unqualified name coerced totype
usingField.coerce(Class)
, ornull
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.
NOTE [#15286]: It is strongly recommended to pass only
Class
references of types supported by jOOQ internally, i.e. types fromSQLDataType
. If you're using any custom data types by means of aConverter
orBinding
, it's better to pass that convertedDataType
reference explicitly tofield(Name, DataType)
.- Parameters:
name
- The unqualified name of the fieldtype
- The type to coerce the resulting field to
-
field
Get a field known to this type by unqualified name coerced todataType
usingField.coerce(DataType)
, ornull
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.
- Parameters:
name
- The unqualified name of the fielddataType
- The data type to coerce the resulting field to
-
field
Get a field known to this type by qualified name, ornull
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.
- Parameters:
name
- The qualified name of the field
-
field
Get a field known to this type by qualified name coerced totype
usingField.coerce(Class)
, ornull
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.
NOTE [#15286]: It is strongly recommended to pass only
Class
references of types supported by jOOQ internally, i.e. types fromSQLDataType
. If you're using any custom data types by means of aConverter
orBinding
, it's better to pass that convertedDataType
reference explicitly tofield(Name, DataType)
.- Parameters:
name
- The qualified name of the fieldtype
- The type to coerce the resulting field to
-
field
Get a field known to this type by qualified name coerced todataType
usingField.coerce(DataType)
, ornull
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.
- Parameters:
name
- The qualified name of the fielddataType
- The data type to coerce the resulting field to
-
field
Get a field known to this type by index, ornull
if no field is available at the index.- Parameters:
index
- The 0-based index of the field
-
field
Get a field known to this type by index coerced totype
usingField.coerce(Class)
, ornull
if no field is available at the index.NOTE [#15286]: It is strongly recommended to pass only
Class
references of types supported by jOOQ internally, i.e. types fromSQLDataType
. If you're using any custom data types by means of aConverter
orBinding
, it's better to pass that convertedDataType
reference explicitly tofield(Name, DataType)
.- Parameters:
index
- The 0-based index of the fieldtype
- The type to coerce the resulting field to
-
field
Get a field known to this type by index coerced todataType
usingField.coerce(DataType)
, ornull
if no field is available at the index.- Parameters:
index
- The 0-based index of the fielddataType
- The data type to coerce the resulting field to
-
fields
Get all fields, filtering by some fields.- Parameters:
fields
- The fields to include after looking them up viafield(Field)
.- See Also:
-
fields
Get all fields known to this type, filtering by some unqualified field names.- Parameters:
names
- The unqualified field names to include after looking them up viafield(String)
.- See Also:
-
fields
Get all fields known to this type, filtering by some qualified field names.- Parameters:
names
- The qualified field names to include after looking them up viafield(Name)
.- See Also:
-
fields
Get all fields known to this type, filtering by some field indexes.- Parameters:
names
- The 0-based field indexes to include after looking them up viafield(int)
.- See Also:
-
indexOf
Get a field's index from this type.The lookup algorithm is the same as that of
field(Field)
.- 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
Get a field's index from this type.The lookup algorithm is the same as that of
field(String)
.- Parameters:
name
- 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
Get a field's index from this type.The lookup algorithm is the same as that of
field(Name)
.- Parameters:
name
- 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
Get an array of field types for fields known to this type.Entries in the resulting array correspond to
Typed.getType()
for the correspondingField
infields()
-
type
Get the field type for a given field index, ornull
if no field is available at the index.- Parameters:
index
- The field's 0-based index
-
type
Get the field type for a given unqualified field name, ornull
if no field is known to this type by this name.The lookup algorithm is the same as that of
field(String)
.- Parameters:
name
- The unqualified field name
-
type
Get the field type for a given qualified field name, ornull
if no field is known to this type by this name.The lookup algorithm is the same as that of
field(Name)
.- Parameters:
name
- The qualified field name
-
dataTypes
Get an array of field data types for this type.Entries in the resulting array correspond to
Typed.getDataType()
for the correspondingField
infields()
-
dataType
Get the field data type for a given field index, ornull
if no field is available at the index.- Parameters:
index
- The field's 0-based index
-
dataType
Get the field data type for a given qualified field name, ornull
if no field is known to this type by this name.The lookup algorithm is the same as that of
field(String)
.- Parameters:
name
- The qualified field name
-
dataType
Get the field data type for a given qualified field name, ornull
if no field is known to this type by this name.The lookup algorithm is the same as that of
field(Name)
.- Parameters:
name
- The qualified field name
-