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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionintoArray
(E[] a) Create a collector that can collectRecord1
resulting from a single columnResultQuery
into an array of that column's type.Create a collector that can collectRecord
resulting from aResultQuery
into an array of a mapped type.Create a collector that can collectRecord
resulting from aResultQuery
into an array of a mapped type.Create a collector that can collectRecord
resulting from aResultQuery
into an array of a mapped type.Create a collector that can collectRecord2
resulting from a 2-columnResultQuery
into aMap
using the first column as key collecting values of the second column into a list of values.intoGroups
(Function<? super R, ? extends K> keyMapper) Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
as key collecting the records themselves into a list of values.intoGroups
(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper) Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
as key collecting the result of another argumentRecordMapper
into a list of values.intoHierarchy
(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends K> parentKeyMapper, Function<? super R, ? extends E> nodeMapper, BiConsumer<? super E, ? super E> parentChildAppender) Create a collector that can collectRecord
resulting from aResultQuery
into a hierarchy of custom data types.intoList()
Create a collector that can collectRecord1
resulting from a single columnResultQuery
into aList
of that column's type.Create a collector that can collectRecord
resulting from aResultQuery
into aList
of a mapped type.intoMap()
Create a collector that can collectRecord2
resulting from a 2-columnResultQuery
into aMap
using the first column as key and the second column as value.Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
as key and the record itself as value.Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
as key and the result of another argumentRecordMapper
as value.intoResultGroups
(Function<? super R, ? extends K> keyMapper) Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
as key collecting the records themselves into aResult
.intoResultGroups
(Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper) Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
as key collecting the result of another argumentRecordMapper
into aResult
of values.intoSet()
Create a collector that can collectRecord1
resulting from a single columnResultQuery
into aSet
of that column's type.Create a collector that can collectRecord
resulting from aResultQuery
into aSet
of a mapped type.static final <T1,
R extends Record1<T1>, U>
RecordMapper<R, U> Create aRecordMapper
that can map fromRecord1
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord10
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord11
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord12
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord13
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord14
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord15
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord16
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord17
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord18
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord19
to a user type in a type safe way.static final <T1,
T2, R extends Record2<T1, T2>, U>
RecordMapper<R, U> Create aRecordMapper
that can map fromRecord2
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord20
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord21
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord22
to a user type in a type safe way.static final <T1,
T2, T3, R extends Record3<T1, T2, T3>, U>
RecordMapper<R, U> Create aRecordMapper
that can map fromRecord3
to a user type in a type safe way.static final <T1,
T2, T3, T4, R extends Record4<T1, T2, T3, T4>, U>
RecordMapper<R, U> Create aRecordMapper
that can map fromRecord4
to a user type in a type safe way.static final <T1,
T2, T3, T4, T5, R extends Record5<T1, T2, T3, T4, T5>, U>
RecordMapper<R, U> Create aRecordMapper
that can map fromRecord5
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord6
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord7
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord8
to a user type in a type safe way.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 aRecordMapper
that can map fromRecord9
to a user type in a type safe way.static final <R extends Record>
RecordMapper<R, @Nullable R> static final <R extends Record>
RecordMapper<R, @Nullable R>
-
Constructor Details
-
Records
public Records()
-
-
Method Details
-
intoArray
Create a collector that can collectRecord1
resulting from a single columnResultQuery
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);
-
intoArray
public static final <E,R extends Record1<E>> Collector<R,?, intoArrayE[]> (Class<? extends E> componentType) Create a collector that can collectRecord
resulting from aResultQuery
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);
-
intoArray
public static final <E,R extends Record> Collector<R,?, intoArrayE[]> (E[] a, Function<? super R, ? extends E> function) Create a collector that can collectRecord
resulting from aResultQuery
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);
-
intoArray
public static final <E,R extends Record> Collector<R,?, intoArrayE[]> (Class<? extends E> componentType, Function<? super R, ? extends E> function) Create a collector that can collectRecord
resulting from aResultQuery
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);
-
intoList
Create a collector that can collectRecord1
resulting from a single columnResultQuery
into aList
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);
-
intoList
public static final <E,R extends Record> Collector<R,?, intoListList<E>> (Function<? super R, ? extends E> function) Create a collector that can collectRecord
resulting from aResultQuery
into aList
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);
-
intoSet
Create a collector that can collectRecord1
resulting from a single columnResultQuery
into aSet
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);
-
intoSet
public static final <E,R extends Record> Collector<R,?, intoSetSet<E>> (Function<? super R, ? extends E> function) Create a collector that can collectRecord
resulting from aResultQuery
into aSet
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);
-
intoMap
Create a collector that can collectRecord2
resulting from a 2-columnResultQuery
into aMap
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
andBOOK.TITLE
columns:Map<Integer, String> books = ctx.select(BOOK.ID, BOOK.TITLE) .from(BOOK) .fetchMap(BOOK.ID, BOOK.TITLE);
-
intoMap
public static final <K,R extends Record> Collector<R,?, intoMapMap<K, R>> (Function<? super R, ? extends K> keyMapper) Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
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);
-
intoMap
public static final <K,V, Collector<R,R extends Record> ?, intoMapMap<K, V>> (Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper) Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
as key and the result of another argumentRecordMapper
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);
-
intoGroups
Create a collector that can collectRecord2
resulting from a 2-columnResultQuery
into aMap
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
andBOOK.TITLE
columns:Map<Integer, List<String>> books = ctx.select(BOOK.ID, BOOK.TITLE) .from(BOOK) .fetchGroups(BOOK.ID, BOOK.TITLE);
-
intoGroups
public static final <K,R extends Record> Collector<R,?, intoGroupsMap<K, List<R>>> (Function<? super R, ? extends K> keyMapper) Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
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);
-
intoGroups
public static final <K,V, Collector<R,R extends Record> ?, intoGroupsMap<K, List<V>>> (Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper) Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
as key collecting the result of another argumentRecordMapper
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);
-
intoResultGroups
public static final <K,R extends Record> Collector<R,?, intoResultGroupsMap<K, Result<R>>> (Function<? super R, ? extends K> keyMapper) Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
as key collecting the records themselves into aResult
.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);
-
intoResultGroups
public static final <K,V extends Record, Collector<R,R extends Record> ?, intoResultGroupsMap<K, Result<V>>> (Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends V> valueMapper) Create a collector that can collectRecord
resulting from aResultQuery
into aMap
using the result of the argumentRecordMapper
as key collecting the result of another argumentRecordMapper
into aResult
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);
-
intoHierarchy
public static final <K,E, Collector<R,R extends Record> ?, intoHierarchyList<E>> (Function<? super R, ? extends K> keyMapper, Function<? super R, ? extends K> parentKeyMapper, Function<? super R, ? extends E> nodeMapper, BiConsumer<? super E, ? super E> parentChildAppender) Create a collector that can collectRecord
resulting from aResultQuery
into a hierarchy of custom data types.For example:
record File(String name, List<File> contents) {} List<File> files = ctx.select(FILE.ID, FILE.PARENT_ID, FILE.NAME) .from(FILE) .collect(intoHierarchy( r -> r.value1(), r -> r.value2(), r -> new File(r.value3(), new ArrayListinvalid input: '<'>()), (p, c) -> p.contents().add(c) ));
- Type Parameters:
K
- The key type (e.g. anID
)E
- The value type (e.g. a POJO)R
- The record type- Parameters:
keyMapper
- A function that extract a key from a recordparentKeyMapper
- A function that extracts the parent key from a record.nodeMapper
- A function that maps a record to a new value type.parentChildAppender
- A (parent, child) consumer that adds the child to its parent.
-
nullOnAllNull
Create aRecordMapper
that turnsRecord
values containing allnull
values into anull
record value.This is useful, for example, when nesting records from implicit path joins following optional foreign keys, where a
(NULL, NULL, …, NULL)
record isn't so useful. -
nullOnAnyNull
Create aRecordMapper
that turnsRecord
values containing anynull
value into anull
record value.This is useful, for example, when nesting records from implicit path joins following optional foreign keys, where a
(NULL, NULL, …, NULL)
record isn't so useful. -
mapping
public static final <T1,R extends Record1<T1>, RecordMapper<R,U> U> mapping(Function1<? super T1, ? extends U> function) Create aRecordMapper
that can map fromRecord1
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function1)
orFunctions.nullOnAnyNull(Function1)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,R extends Record2<T1, T2>, U> U> mapping(Function2<? super T1, ? super T2, ? extends U> function) Create aRecordMapper
that can map fromRecord2
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function2)
orFunctions.nullOnAnyNull(Function2)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,T3, R extends Record3<T1, T2, T3>, U> U> mapping(Function3<? super T1, ? super T2, ? super T3, ? extends U> function) Create aRecordMapper
that can map fromRecord3
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function3)
orFunctions.nullOnAnyNull(Function3)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,T3, T4, R extends Record4<T1, T2, T3, T4>, U> U> mapping(Function4<? super T1, ? super T2, ? super T3, ? super T4, ? extends U> function) Create aRecordMapper
that can map fromRecord4
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function4)
orFunctions.nullOnAnyNull(Function4)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,T3, T4, T5, R extends Record5<T1, T2, T3, T4, T5>, U> U> mapping(Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends U> function) Create aRecordMapper
that can map fromRecord5
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function5)
orFunctions.nullOnAnyNull(Function5)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,T3, T4, T5, T6, R extends Record6<T1, T2, T3, T4, T5, T6>, U> U> mapping(Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends U> function) Create aRecordMapper
that can map fromRecord6
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function6)
orFunctions.nullOnAnyNull(Function6)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,T3, T4, T5, T6, T7, R extends Record7<T1, T2, T3, T4, T5, T6, T7>, U> U> mapping(Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends U> function) Create aRecordMapper
that can map fromRecord7
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function7)
orFunctions.nullOnAnyNull(Function7)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,T3, T4, T5, T6, T7, T8, R extends Record8<T1, T2, T3, T4, T5, T6, T7, T8>, U> U> mapping(Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends U> function) Create aRecordMapper
that can map fromRecord8
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function8)
orFunctions.nullOnAnyNull(Function8)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,T3, T4, T5, T6, T7, T8, T9, R extends Record9<T1, T2, T3, T4, T5, T6, T7, T8, T9>, U> 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 aRecordMapper
that can map fromRecord9
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function9)
orFunctions.nullOnAnyNull(Function9)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,T3, T4, T5, T6, T7, T8, T9, T10, R extends Record10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, U> 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 aRecordMapper
that can map fromRecord10
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function10)
orFunctions.nullOnAnyNull(Function10)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,T3, T4, T5, T6, T7, T8, T9, T10, T11, R extends Record11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, U> 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 aRecordMapper
that can map fromRecord11
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function11)
orFunctions.nullOnAnyNull(Function11)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,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> 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 aRecordMapper
that can map fromRecord12
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function12)
orFunctions.nullOnAnyNull(Function12)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,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> 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 aRecordMapper
that can map fromRecord13
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function13)
orFunctions.nullOnAnyNull(Function13)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,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> 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 aRecordMapper
that can map fromRecord14
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function14)
orFunctions.nullOnAnyNull(Function14)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,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> 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 aRecordMapper
that can map fromRecord15
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function15)
orFunctions.nullOnAnyNull(Function15)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,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> 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 aRecordMapper
that can map fromRecord16
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function16)
orFunctions.nullOnAnyNull(Function16)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,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> 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 aRecordMapper
that can map fromRecord17
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function17)
orFunctions.nullOnAnyNull(Function17)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,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> 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 aRecordMapper
that can map fromRecord18
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function18)
orFunctions.nullOnAnyNull(Function18)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,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> 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 aRecordMapper
that can map fromRecord19
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function19)
orFunctions.nullOnAnyNull(Function19)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,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> 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 aRecordMapper
that can map fromRecord20
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function20)
orFunctions.nullOnAnyNull(Function20)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,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> 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 aRecordMapper
that can map fromRecord21
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function21)
orFunctions.nullOnAnyNull(Function21)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc. -
mapping
public static final <T1,T2, RecordMapper<R,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> 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 aRecordMapper
that can map fromRecord22
to a user type in a type safe way.Combine this with e.g.
Functions.nullOnAllNull(Function22)
orFunctions.nullOnAnyNull(Function22)
to achievenull
safety when mapping nested rows fromLEFT JOIN
etc.
-