Top Description Methods
org.jooq

public non-sealed Interface SelectField<T>

extends SelectFieldOrAsterisk, Named, Typed<T>
Known Direct Subinterfaces
org.jooq.Table, org.jooq.Row1, org.jooq.Row10, org.jooq.Row11, org.jooq.Row12, org.jooq.Row13, org.jooq.Row14, org.jooq.Row15, org.jooq.Row16, org.jooq.Row17, org.jooq.Row18, org.jooq.Row19, org.jooq.Row2, org.jooq.Row20, org.jooq.Row21, org.jooq.Row22, org.jooq.Row3, org.jooq.Field, org.jooq.Row4, org.jooq.Row5, org.jooq.Row6, org.jooq.Row7, org.jooq.Row8, org.jooq.Row9, org.jooq.RowN
Known Direct Implementers
org.jooq.impl.AbstractRow
Imports
java.util.function.Function, org.jooq.conf.Settings, org.jooq.impl.DSL, org.jetbrains.annotations.NotNull

A QueryPart to be used exclusively in SELECT clauses.

Instances of this type cannot be created directly, only of its subtypes.

Author
Lukas Eder

Method Summary

Modifier and TypeMethod and Description
public @NotNull SelectField<T>

Returns:

The field alias
as
(String
The alias name
alias
)

Create an alias for this field.

public @NotNull SelectField<T>

Returns:

The field alias
as
(Name
The alias name
alias
)

Create an alias for this field.

public @NotNull SelectField<T>

Returns:

The field alias.
as
(Field<?>
The other field whose name this field is aliased with.
otherField
)

Deprecated as a consequence of Field being deprecated.
Create an alias for this field based on another field's name.
public <
The user type.
U
>
@NotNull SelectField<U>

Returns:

A derived field expression using a new binding.
convert
(Binding<T, U>
The binding to be applied on any operations using this field.
binding
)

Apply an ad-hoc data type Binding to this field expression.

public <
The user type.
U
>
@NotNull SelectField<U>

Returns:

A derived field expression using a new converter.
convert
(Converter<T, U>
The converter to be applied on any operations using this field.
converter
)

Apply an ad-hoc data type Converter to this field expression.

public <
The user type.
U
>
@NotNull SelectField<U>

Returns:

A derived field expression using a new converter.
convert
(Class<U>
The converter to be applied on any operations using this field.
toType
,
Function<? super T, ? extends U> from, Function<? super U, ? extends T> to)

Apply an ad-hoc data type Converter to this field expression.

public <
The user type.
U
>
@NotNull SelectField<U>

Returns:

A derived field expression using a new converter.
convertFrom
(Class<U>
The read-only converter to be applied on any operations using this field.
toType
,
Function<? super T, ? extends U> from)

Apply an ad-hoc read-only data type Converter to this field expression.

public <
The user type.
U
>
@NotNull SelectField<U>

Returns:

A derived field expression using a new converter.
convertFrom
(Function<? super T, ? extends U>
The read-only converter to be applied on any operations using this field.
from
)

Apply an ad-hoc read-only data type Converter to this field expression.

public <
The user type.
U
>
@NotNull SelectField<U>

Returns:

A derived field expression using a new converter.
convertTo
(Class<U>
The write-only converter to be applied on any operations using this field.
toType
,
Function<? super U, ? extends T> to)

Apply an ad-hoc write-only data type Converter to this field expression.

public <
The user type.
U
>
@NotNull SelectField<U>

Returns:

A derived field expression using a new converter.
convertTo
(Function<? super U, ? extends T>
The write-only converter to be applied on any operations using this field.
to
)

Apply an ad-hoc write-only data type Converter to this field expression.

Inherited from org.jooq.Named:
$namegetCommentgetCommentPartgetNamegetQualifiedNamegetUnqualifiedName
Inherited from org.jooq.Typed:
$dataTypegetBindinggetConvertergetDataTypegetDataTypegetType

Method Detail

asback to summary
public @NotNull SelectField<T> as(String alias)

Create an alias for this field.

Note that the case-sensitivity of the returned field depends on Settings#getRenderQuotedNames(). By default, field aliases are quoted, and thus case-sensitive in many SQL dialects!

Parameters
alias:String

The alias name

Returns:@NotNull SelectField<T>

The field alias

Annotations
@NotNull
@Support
asback to summary
public @NotNull SelectField<T> as(Name alias)

Create an alias for this field.

Note that the case-sensitivity of the returned field depends on Settings#getRenderQuotedNames() and the Name. By default, field aliases are quoted, and thus case-sensitive in many SQL dialects - use DSL#unquotedName(String...) for case-insensitive aliases.

If the argument Name#getName() is qualified, then the Name#last() part will be used.

Parameters
alias:Name

The alias name

Returns:@NotNull SelectField<T>

The field alias

Annotations
@NotNull
@Support
asback to summary
public @NotNull SelectField<T> as(Field<?> otherField)

Deprecated

as a consequence of Field being deprecated. See corresponding docs for further information.

Create an alias for this field based on another field's name.

Parameters
otherField:Field<?>

The other field whose name this field is aliased with.

Returns:@NotNull SelectField<T>

The field alias.

Annotations
@NotNull
@Support
convertback to summary
public <U> @NotNull SelectField<U> convert(Binding<T, U> binding)

Apply an ad-hoc data type Binding to this field expression.

Rather than attaching data type bindings at code generation time, or creating cumbersome expressions using DataType#asConvertedDataType(Binding), this method allows for creating a derived field expression with an ad-hoc data type binding for single query usage.

Parameters
<U>
The user type.
binding:Binding<T, U>

The binding to be applied on any operations using this field.

Returns:@NotNull SelectField<U>

A derived field expression using a new binding.

Annotations
@NotNull
convertback to summary
public <U> @NotNull SelectField<U> convert(Converter<T, U> converter)

Apply an ad-hoc data type Converter to this field expression.

Rather than attaching data type converters at code generation time, or creating cumbersome expressions using DataType#asConvertedDataType(Converter), this method allows for creating a derived field expression with an ad-hoc data type converter for single query usage.

Parameters
<U>
The user type.
converter:Converter<T, U>

The converter to be applied on any operations using this field.

Returns:@NotNull SelectField<U>

A derived field expression using a new converter.

Annotations
@NotNull
convertback to summary
public <U> @NotNull SelectField<U> convert(Class<U> toType, Function<? super T, ? extends U> from, Function<? super U, ? extends T> to)

Apply an ad-hoc data type Converter to this field expression.

Rather than attaching data type converters at code generation time, or creating cumbersome expressions using DataType#asConvertedDataType(Class, Function, Function), this method allows for creating a derived field expression with an ad-hoc data type converter for single query usage.

Parameters
<U>
The user type.
toType:Class<U>

The converter to be applied on any operations using this field.

Returns:@NotNull SelectField<U>

A derived field expression using a new converter.

Annotations
@NotNull
convertFromback to summary
public <U> @NotNull SelectField<U> convertFrom(Class<U> toType, Function<? super T, ? extends U> from)

Apply an ad-hoc read-only data type Converter to this field expression.

Rather than attaching data type converters at code generation time, or creating cumbersome expressions using DataType#asConvertedDataTypeFrom(Class, Function), this method allows for creating a derived field expression with an ad-hoc data type converter for single query usage.

Parameters
<U>
The user type.
toType:Class<U>

The read-only converter to be applied on any operations using this field.

Returns:@NotNull SelectField<U>

A derived field expression using a new converter.

Annotations
@NotNull
convertFromback to summary
public <U> @NotNull SelectField<U> convertFrom(Function<? super T, ? extends U> from)

Apply an ad-hoc read-only data type Converter to this field expression.

Rather than attaching data type converters at code generation time, or creating cumbersome expressions using DataType#asConvertedDataTypeFrom(Class, Function), this method allows for creating a derived field expression with an ad-hoc data type converter for single query usage.

Unlike convertFrom(Class, Function), this method attempts to work without an explicit Class reference for the underlying Converter#toType(). There may be some edge cases where this doesn't work, e.g. when nesting rows in arrays, the class literal is required for reflective array creation.

Parameters
<U>
The user type.
from:Function<? super T, ? extends U>

The read-only converter to be applied on any operations using this field.

Returns:@NotNull SelectField<U>

A derived field expression using a new converter.

Annotations
@NotNull
convertToback to summary
public <U> @NotNull SelectField<U> convertTo(Class<U> toType, Function<? super U, ? extends T> to)

Apply an ad-hoc write-only data type Converter to this field expression.

Rather than attaching data type converters at code generation time, or creating cumbersome expressions using DataType#asConvertedDataTypeTo(Class, Function), this method allows for creating a derived field expression with an ad-hoc data type converter for single query usage.

Parameters
<U>
The user type.
toType:Class<U>

The write-only converter to be applied on any operations using this field.

Returns:@NotNull SelectField<U>

A derived field expression using a new converter.

Annotations
@NotNull
convertToback to summary
public <U> @NotNull SelectField<U> convertTo(Function<? super U, ? extends T> to)

Apply an ad-hoc write-only data type Converter to this field expression.

Rather than attaching data type converters at code generation time, or creating cumbersome expressions using DataType#asConvertedDataTypeTo(Class, Function), this method allows for creating a derived field expression with an ad-hoc data type converter for single query usage.

Unlike convertTo(Class, Function), this method attempts to work without an explicit Class reference for the underlying Converter#toType(). There may be some edge cases where this doesn't work, e.g. when nesting rows in arrays, the class literal is required for reflective array creation.

Parameters
<U>
The user type.
to:Function<? super U, ? extends T>

The write-only converter to be applied on any operations using this field.

Returns:@NotNull SelectField<U>

A derived field expression using a new converter.

Annotations
@NotNull