Top Description Fields Constructors Methods
org.jooq

public final Class Records

extends Object
Class Inheritance
Static Imports
java.util.stream.Collectors.collectingAndThen, .Collectors.toCollection

Common utilities related to Record types and constructing RecordMapper.

The various mapping() methods can be used e.g. to map between Record types and constructors of known degree, such as in this example:


record Actor (int id, String firstName, String lastName) {}

List<Actor> actors =
ctx.select(ACTOR.ID, ACTOR.FIRST_NAME, ACTOR.LAST_NAME)
   .from(ACTOR)
   .fetch(mapping(Actor::new));
Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private static final Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final <E, R extends Record1<E>> Collector<R, ?, E[]>
intoArray(E[] a)

Create a collector that can collect Record1 resulting from a single column ResultQuery into an array of that column's type.

public static final <E, R extends Record1<E>> Collector<R, ?, E[]>
intoArray(Class<? extends E> componentType)

Create a collector that can collect Record resulting from a ResultQuery into an array of a mapped type.

public static final <E, R extends Record> Collector<R, ?, E[]>
intoArray(E[] a, Function<? super R, ? extends E> function)

Create a collector that can collect Record resulting from a ResultQuery into an array of a mapped type.

public static final <E, R extends Record> Collector<R, ?, E[]>
intoArray(Class<? extends E> componentType, Function<? super R, ? extends E> function)

Create a collector that can collect Record resulting from a ResultQuery into an array of a mapped type.

public static final <K, V, R extends Record2<K, V>> Collector<R, ?, Map<K, List<V>>>
intoGroups()

Create a collector that can collect Record2 resulting from a 2-column ResultQuery into a Map using the first column as key collecting values of the second column into a list of values.

public static final <K, R extends Record> Collector<R, ?, Map<K, List<R>>>
intoGroups(Function<? super R, ? extends K> keyMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key collecting the records themselves into a list of values.

public static final <K, V, R extends Record> Collector<R, ?, Map<K, List<V>>>
intoGroups(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key collecting the result of another argument RecordMapper into a list of values.

public static final <E, R extends Record1<E>> Collector<R, ?, List<E>>
intoList()

Create a collector that can collect Record1 resulting from a single column ResultQuery into a List of that column's type.

public static final <E, R extends Record> Collector<R, ?, List<E>>
intoList(Function<? super R, ? extends E> function)

Create a collector that can collect Record resulting from a ResultQuery into a List of a mapped type.

public static final <K, V, R extends Record2<K, V>> Collector<R, ?, Map<K, V>>
intoMap()

Create a collector that can collect Record2 resulting from a 2-column ResultQuery into a Map using the first column as key and the second column as value.

public static final <K, R extends Record> Collector<R, ?, Map<K, R>>
intoMap(Function<? super R, ? extends K> keyMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key and the record itself as value.

public static final <K, V, R extends Record> Collector<R, ?, Map<K, V>>
intoMap(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key and the result of another argument RecordMapper as value.

public static final <K, R extends Record> Collector<R, ?, Map<K, Result<R>>>
intoResultGroups(Function<? super R, ? extends K> keyMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key collecting the records themselves into a Result.

public static final <K, V extends Record, R extends Record> Collector<R, ?, Map<K, Result<V>>>
intoResultGroups(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key collecting the result of another argument RecordMapper into a Result of values.

public static final <E, R extends Record1<E>> Collector<R, ?, Set<E>>
intoSet()

Create a collector that can collect Record1 resulting from a single column ResultQuery into a Set of that column's type.

public static final <E, R extends Record> Collector<R, ?, Set<E>>
intoSet(Function<? super R, ? extends E> function)

Create a collector that can collect Record resulting from a ResultQuery into a Set of a mapped type.

public static final <T1, R extends Record1<T1>, U> RecordMapper<R, U>
mapping(Function1<? super T1, ? extends U> function)

Create a RecordMapper that can map from Record1 to a user type in a type safe way.

public static final <T1, T2, R extends Record2<T1, T2>, U> RecordMapper<R, U>
mapping(Function2<? super T1, ? super T2, ? extends U> function)

Create a RecordMapper that can map from Record2 to a user type in a type safe way.

public static final <T1, T2, T3, R extends Record3<T1, T2, T3>, U> RecordMapper<R, U>
mapping(Function3<? super T1, ? super T2, ? super T3, ? extends U> function)

Create a RecordMapper that can map from Record3 to a user type in a type safe way.

public static final <T1, T2, T3, T4, R extends Record4<T1, T2, T3, T4>, U> RecordMapper<R, U>
mapping(Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends U> function)

Create a RecordMapper that can map from Record4 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, R extends Record5<T1, T2, T3, T4, T5>, U> RecordMapper<R, U>
mapping(Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends U> function)

Create a RecordMapper that can map from Record5 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, R extends Record6<T1, T2, T3, T4, T5, T6>, U> RecordMapper<R, U>
mapping(Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends U> function)

Create a RecordMapper that can map from Record6 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, R extends Record7<T1, T2, T3, T4, T5, T6, T7>, U> RecordMapper<R, U>
mapping(Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends U> function)

Create a RecordMapper that can map from Record7 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, R extends Record8<T1, T2, T3, T4, T5, T6, T7, T8>, U> RecordMapper<R, U>
mapping(Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends U> function)

Create a RecordMapper that can map from Record8 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, R extends Record9<T1, T2, T3, T4, T5, T6, T7, T8, T9>, U> RecordMapper<R, U>
mapping(Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends U> function)

Create a RecordMapper that can map from Record9 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R extends Record10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, U> RecordMapper<R, U>
mapping(Function10<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? extends U> function)

Create a RecordMapper that can map from Record10 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R extends Record11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, U> RecordMapper<R, U>
mapping(Function11<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? extends U> function)

Create a RecordMapper that can map from Record11 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R extends Record12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, U> RecordMapper<R, U>
mapping(Function12<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? extends U> function)

Create a RecordMapper that can map from Record12 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R extends Record13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, U> RecordMapper<R, U>
mapping(Function13<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? extends U> function)

Create a RecordMapper that can map from Record13 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R extends Record14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, U> RecordMapper<R, U>
mapping(Function14<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? extends U> function)

Create a RecordMapper that can map from Record14 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R extends Record15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, U> RecordMapper<R, U>
mapping(Function15<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? extends U> function)

Create a RecordMapper that can map from Record15 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R extends Record16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, U> RecordMapper<R, U>
mapping(Function16<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? extends U> function)

Create a RecordMapper that can map from Record16 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R extends Record17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>, U> RecordMapper<R, U>
mapping(Function17<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? extends U> function)

Create a RecordMapper that can map from Record17 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R extends Record18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>, U> RecordMapper<R, U>
mapping(Function18<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? extends U> function)

Create a RecordMapper that can map from Record18 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R extends Record19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>, U> RecordMapper<R, U>
mapping(Function19<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? extends U> function)

Create a RecordMapper that can map from Record19 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R extends Record20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>, U> RecordMapper<R, U>
mapping(Function20<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? extends U> function)

Create a RecordMapper that can map from Record20 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R extends Record21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>, U> RecordMapper<R, U>
mapping(Function21<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? super T21, ? extends U> function)

Create a RecordMapper that can map from Record21 to a user type in a type safe way.

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R extends Record22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>, U> RecordMapper<R, U>
mapping(Function22<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? super T21, ? super T22, ? extends U> function)

Create a RecordMapper that can map from Record22 to a user type in a type safe way.

private static final <K, V> Function<Map<Object, V>, Map<K, V>>
private static final <T> Function<T, Object>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

NULLback to summary
private static final Object NULL

Constructor Detail

Recordsback to summary
public Records()

Method Detail

intoArrayback to summary
public static final <E, R extends Record1<E>> Collector<R, ?, E[]> intoArray(E[] a)

Create a collector that can collect Record1 resulting from a single column ResultQuery into an array of that column's type.

For example:


String[] titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .collect(intoArray(new String[0]));

This is the same as the following, but allows for omitting repeating the BOOK.TITLE column:


String[] titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .fetchArray(BOOK.TITLE);
intoArrayback to summary
public static final <E, R extends Record1<E>> Collector<R, ?, E[]> intoArray(Class<? extends E> componentType)

Create a collector that can collect Record resulting from a ResultQuery into an array of a mapped type.

For example:


String[] titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .collect(intoArray(new String[0], r -> r.get(BOOK.TITLE)));

This is the same as the following:


String[] titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .fetchArray(BOOK.TITLE);
intoArrayback to summary
public static final <E, R extends Record> Collector<R, ?, E[]> intoArray(E[] a, Function<? super R, ? extends E> function)

Create a collector that can collect Record resulting from a ResultQuery into an array of a mapped type.

For example:


String[] titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .collect(intoArray(new String[0], r -> r.get(BOOK.TITLE)));

This is the same as the following:


String[] titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .fetchArray(BOOK.TITLE);
intoArrayback to summary
public static final <E, R extends Record> Collector<R, ?, E[]> intoArray(Class<? extends E> componentType, Function<? super R, ? extends E> function)

Create a collector that can collect Record resulting from a ResultQuery into an array of a mapped type.

For example:


String[] titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .collect(intoArray(new String[0], r -> r.get(BOOK.TITLE)));

This is the same as the following:


String[] titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .fetchArray(BOOK.TITLE);
Annotations
@SuppressWarnings:unchecked
intoGroupsback to summary
public static final <K, V, R extends Record2<K, V>> Collector<R, ?, Map<K, List<V>>> intoGroups()

Create a collector that can collect Record2 resulting from a 2-column ResultQuery into a Map using the first column as key collecting values of the second column into a list of values.

For example:


Map<Integer, List<String>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .collect(intoGroups());

This is the same as the following, but allows for omitting repeating the BOOK.ID and BOOK.TITLE columns:


Map<Integer, List<String>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .fetchGroups(BOOK.ID, BOOK.TITLE);
intoGroupsback to summary
public static final <K, R extends Record> Collector<R, ?, Map<K, List<R>>> intoGroups(Function<? super R, ? extends K> keyMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key collecting the records themselves into a list of values.

For example:


Map<Integer, List<Record2<Integer, String>>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .collect(intoGroups(r -> r.get(BOOK.ID)));

This is the same as the following:


Map<Integer, List<Record2<Integer, String>>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .fetchGroups(BOOK.ID);
intoGroupsback to summary
public static final <K, V, R extends Record> Collector<R, ?, Map<K, List<V>>> intoGroups(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key collecting the result of another argument RecordMapper into a list of values.

For example:


Map<Integer, List<String>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .collect(intoGroups(r -> r.get(BOOK.ID), r -> r.get(BOOK.TITLE)));

This is the same as the following:


Map<Integer, List<String>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .fetchGroups(BOOK.ID, BOOK.TITLE);
intoListback to summary
public static final <E, R extends Record1<E>> Collector<R, ?, List<E>> intoList()

Create a collector that can collect Record1 resulting from a single column ResultQuery into a List of that column's type.

For example:


List<String> titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .collect(intoList());

This is the same as the following, but allows for omitting repeating the BOOK.TITLE column:


List<String> titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .fetch(BOOK.TITLE);
intoListback to summary
public static final <E, R extends Record> Collector<R, ?, List<E>> intoList(Function<? super R, ? extends E> function)

Create a collector that can collect Record resulting from a ResultQuery into a List of a mapped type.

For example:


List<String> titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .collect(intoList(r -> r.get(BOOK.TITLE)));

This is the same as the following:


List<String> titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .fetch(BOOK.TITLE);
intoMapback to summary
public static final <K, V, R extends Record2<K, V>> Collector<R, ?, Map<K, V>> intoMap()

Create a collector that can collect Record2 resulting from a 2-column ResultQuery into a Map using the first column as key and the second column as value.

Collection throws InvalidResultException if a key is encountered more than once.

For example:


Map<Integer, String> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .collect(intoMap());

This is the same as the following, but allows for omitting repeating the BOOK.ID and BOOK.TITLE columns:


Map<Integer, String> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .fetchMap(BOOK.ID, BOOK.TITLE);
intoMapback to summary
public static final <K, R extends Record> Collector<R, ?, Map<K, R>> intoMap(Function<? super R, ? extends K> keyMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key and the record itself as value.

Collection throws InvalidResultException if a key is encountered more than once.

For example:


Map<Integer, Record2<Integer, String>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .collect(intoMap(r -> r.get(BOOK.ID)));

This is the same as the following:


Map<Integer, Record2<Integer, String>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .fetchMap(BOOK.ID);
intoMapback to summary
public static final <K, V, R extends Record> Collector<R, ?, Map<K, V>> intoMap(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key and the result of another argument RecordMapper as value.

Collection throws InvalidResultException if a key is encountered more than once.

For example:


Map<Integer, String> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .collect(intoMap(r -> r.get(BOOK.ID), r -> r.get(BOOK.TITLE)));

This is the same as the following:


Map<Integer, String> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .fetchMap(BOOK.ID, BOOK.TITLE);
intoResultGroupsback to summary
public static final <K, R extends Record> Collector<R, ?, Map<K, Result<R>>> intoResultGroups(Function<? super R, ? extends K> keyMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key collecting the records themselves into a Result.

For example:


Map<Integer, Result<Record2<Integer, String>>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .collect(intoResultGroups(r -> r.get(BOOK.ID)));

This is the same as the following:


Map<Integer, Result<Record2<Integer, String>>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .fetchGroups(BOOK.ID);
intoResultGroupsback to summary
public static final <K, V extends Record, R extends Record> Collector<R, ?, Map<K, Result<V>>> intoResultGroups(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper)

Create a collector that can collect Record resulting from a ResultQuery into a Map using the result of the argument RecordMapper as key collecting the result of another argument RecordMapper into a Result of values.

For example:


Map<Integer, Result<Record1<String>>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .collect(intoResultGroups(r -> r.get(BOOK.ID), r -> r.get(BOOK.TITLE)));

This is the same as the following:


Map<Integer, Result<Record1<String>>> books =
ctx.select(BOOK.ID, BOOK.TITLE)
   .from(BOOK)
   .fetchGroups(BOOK.ID, BOOK.TITLE);
Annotations
@SuppressWarnings:unchecked
intoSetback to summary
public static final <E, R extends Record1<E>> Collector<R, ?, Set<E>> intoSet()

Create a collector that can collect Record1 resulting from a single column ResultQuery into a Set of that column's type.

For example:


Set<String> titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .collect(intoSet());

This is the same as the following, but allows for omitting repeating the BOOK.TITLE column:


List<String> titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .fetchSet(BOOK.TITLE);
intoSetback to summary
public static final <E, R extends Record> Collector<R, ?, Set<E>> intoSet(Function<? super R, ? extends E> function)

Create a collector that can collect Record resulting from a ResultQuery into a Set of a mapped type.

For example:


Set<String> titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .collect(intoSet(r -> r.get(BOOK.TITLE)));

This is the same as the following:


List<String> titles =
ctx.select(BOOK.TITLE)
   .from(BOOK)
   .fetchSet(BOOK.TITLE);
mappingback to summary
public static final <T1, R extends Record1<T1>, U> RecordMapper<R, U> mapping(Function1<? super T1, ? extends U> function)

Create a RecordMapper that can map from Record1 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function1) or Functions#nullOnAnyNull(Function1) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, R extends Record2<T1, T2>, U> RecordMapper<R, U> mapping(Function2<? super T1, ? super T2, ? extends U> function)

Create a RecordMapper that can map from Record2 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function2) or Functions#nullOnAnyNull(Function2) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, R extends Record3<T1, T2, T3>, U> RecordMapper<R, U> mapping(Function3<? super T1, ? super T2, ? super T3, ? extends U> function)

Create a RecordMapper that can map from Record3 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function3) or Functions#nullOnAnyNull(Function3) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, R extends Record4<T1, T2, T3, T4>, U> RecordMapper<R, U> mapping(Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends U> function)

Create a RecordMapper that can map from Record4 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function4) or Functions#nullOnAnyNull(Function4) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, R extends Record5<T1, T2, T3, T4, T5>, U> RecordMapper<R, U> mapping(Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends U> function)

Create a RecordMapper that can map from Record5 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function5) or Functions#nullOnAnyNull(Function5) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, R extends Record6<T1, T2, T3, T4, T5, T6>, U> RecordMapper<R, U> mapping(Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends U> function)

Create a RecordMapper that can map from Record6 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function6) or Functions#nullOnAnyNull(Function6) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, R extends Record7<T1, T2, T3, T4, T5, T6, T7>, U> RecordMapper<R, U> mapping(Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends U> function)

Create a RecordMapper that can map from Record7 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function7) or Functions#nullOnAnyNull(Function7) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, R extends Record8<T1, T2, T3, T4, T5, T6, T7, T8>, U> RecordMapper<R, U> mapping(Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends U> function)

Create a RecordMapper that can map from Record8 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function8) or Functions#nullOnAnyNull(Function8) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, R extends Record9<T1, T2, T3, T4, T5, T6, T7, T8, T9>, U> RecordMapper<R, U> mapping(Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends U> function)

Create a RecordMapper that can map from Record9 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function9) or Functions#nullOnAnyNull(Function9) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R extends Record10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, U> RecordMapper<R, U> mapping(Function10<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? extends U> function)

Create a RecordMapper that can map from Record10 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function10) or Functions#nullOnAnyNull(Function10) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R extends Record11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, U> RecordMapper<R, U> mapping(Function11<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? extends U> function)

Create a RecordMapper that can map from Record11 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function11) or Functions#nullOnAnyNull(Function11) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R extends Record12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, U> RecordMapper<R, U> mapping(Function12<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? extends U> function)

Create a RecordMapper that can map from Record12 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function12) or Functions#nullOnAnyNull(Function12) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, R extends Record13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, U> RecordMapper<R, U> mapping(Function13<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? extends U> function)

Create a RecordMapper that can map from Record13 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function13) or Functions#nullOnAnyNull(Function13) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, R extends Record14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, U> RecordMapper<R, U> mapping(Function14<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? extends U> function)

Create a RecordMapper that can map from Record14 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function14) or Functions#nullOnAnyNull(Function14) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R extends Record15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, U> RecordMapper<R, U> mapping(Function15<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? extends U> function)

Create a RecordMapper that can map from Record15 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function15) or Functions#nullOnAnyNull(Function15) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, R extends Record16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, U> RecordMapper<R, U> mapping(Function16<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? extends U> function)

Create a RecordMapper that can map from Record16 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function16) or Functions#nullOnAnyNull(Function16) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, R extends Record17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>, U> RecordMapper<R, U> mapping(Function17<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? extends U> function)

Create a RecordMapper that can map from Record17 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function17) or Functions#nullOnAnyNull(Function17) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, R extends Record18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>, U> RecordMapper<R, U> mapping(Function18<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? extends U> function)

Create a RecordMapper that can map from Record18 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function18) or Functions#nullOnAnyNull(Function18) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, R extends Record19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>, U> RecordMapper<R, U> mapping(Function19<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? extends U> function)

Create a RecordMapper that can map from Record19 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function19) or Functions#nullOnAnyNull(Function19) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, R extends Record20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>, U> RecordMapper<R, U> mapping(Function20<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? extends U> function)

Create a RecordMapper that can map from Record20 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function20) or Functions#nullOnAnyNull(Function20) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, R extends Record21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>, U> RecordMapper<R, U> mapping(Function21<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? super T21, ? extends U> function)

Create a RecordMapper that can map from Record21 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function21) or Functions#nullOnAnyNull(Function21) to achieve null safety when mapping nested rows from LEFT JOIN etc.

mappingback to summary
public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, R extends Record22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>, U> RecordMapper<R, U> mapping(Function22<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? super T10, ? super T11, ? super T12, ? super T13, ? super T14, ? super T15, ? super T16, ? super T17, ? super T18, ? super T19, ? super T20, ? super T21, ? super T22, ? extends U> function)

Create a RecordMapper that can map from Record22 to a user type in a type safe way.

Combine this with e.g. Functions#nullOnAllNull(Function22) or Functions#nullOnAnyNull(Function22) to achieve null safety when mapping nested rows from LEFT JOIN etc.

unwrapNullsback to summary
private static final <K, V> Function<Map<Object, V>, Map<K, V>> unwrapNulls()
Annotations
@SuppressWarnings:unchecked, rawtypes
wrapNullsback to summary
private static final <T> Function<T, Object> wrapNulls()