Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.jooq.Result Maven / Gradle / Ivy
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
import java.util.stream.Collector;
import java.util.stream.Stream;
import org.jooq.exception.DataAccessException;
import org.jooq.exception.DataTypeException;
import org.jooq.exception.InvalidResultException;
import org.jooq.exception.MappingException;
import org.jooq.impl.DefaultRecordMapper;
import org.jetbrains.annotations.Blocking;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* A wrapper for database results returned by {@link SelectQuery}
.
*
* @param The record type contained in this result
* @author Lukas Eder
* @see SelectQuery#getResult()
*/
public interface Result extends Fields, List, Attachable, Formattable {
/**
* Get this result's record type.
*/
@NotNull
RecordType recordType();
/**
* Convenience method to fetch a value at a given position in the result,
* using {@link #field(Field)} for lookup.
*
* @param The value's field's generic type parameter
* @param index The record's 0-based index in the record list
* @param field The value's field
* @return The value
* @throws IndexOutOfBoundsException if the index is out of range (
* index < 0 || index >= size()
)
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
*/
T getValue(int index, Field field) throws IndexOutOfBoundsException, IllegalArgumentException;
/**
* Convenience method to fetch a value at a given position in the result.
*
* @param index The record's 0-based index in the record list
* @param fieldIndex The value's field index
* @return The value
* @throws IndexOutOfBoundsException if the index is out of range (
* index < 0 || index >= size()
)
* @throws IllegalArgumentException If the argument fieldIndex is not
* contained in {@link #fieldsRow()}
*/
@Nullable
Object getValue(int index, int fieldIndex) throws IndexOutOfBoundsException, IllegalArgumentException;
/**
* Convenience method to fetch a value at a given position in the result,
* using {@link #field(String)} for lookup.
*
* @param index The record's 0-based index in the record list
* @param fieldName The value's field name
* @return The value
* @throws IndexOutOfBoundsException if the index is out of range (
* index < 0 || index >= size()
)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
*/
@Nullable
Object getValue(int index, String fieldName) throws IndexOutOfBoundsException, IllegalArgumentException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field, using
* {@link #field(Field)} for lookup.
*
* @param The values' field's generic type parameter
* @param field The values' field
* @return The values
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
*/
@NotNull
List getValues(Field field) throws IllegalArgumentException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field, using
* {@link #field(Field)} for lookup.
*
* The {@link Converter} that is provided by
* {@link Configuration#converterProvider()} will be used to convert the
* value to U
*
* @param field The values' field
* @param type The type used for type conversion
* @return The values
* @see Record#get(Field, Class)
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
*/
@NotNull
List getValues(Field> field, Class extends U> type) throws IllegalArgumentException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field, using
* {@link #field(Field)} for lookup.
*
* @param field The values' field
* @param converter The data type converter used for type conversion
* @return The values
* @see Record#get(Field, Converter)
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
*/
@NotNull
List getValues(Field field, Converter super T, ? extends U> converter)
throws IllegalArgumentException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field.
*
* @param index The values' 0-based field index
* @return The values
* @throws IllegalArgumentException If the argument fieldIndex is not
* contained in {@link #fieldsRow()}
*/
@NotNull
List> getValues(int index) throws IllegalArgumentException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field.
*
* The {@link Converter} that is provided by
* {@link Configuration#converterProvider()} will be used to convert the
* value to U
*
* @param index The values' 0-based field index
* @param type The type used for type conversion
* @return The values
* @see Record#get(int, Class)
* @throws IllegalArgumentException If the argument fieldIndex is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
@NotNull
List getValues(int index, Class extends U> type) throws IllegalArgumentException, DataTypeException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field.
*
* @param index The values' 0-based field index
* @param converter The data type converter used for type conversion
* @return The values
* @see Record#get(int, Converter)
* @throws IllegalArgumentException If the argument fieldIndex is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
@NotNull
List getValues(int index, Converter, ? extends U> converter)
throws IllegalArgumentException, DataTypeException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field, using
* {@link #field(String)} for lookup.
*
* @param fieldName The values' field name
* @return The values
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
*/
@NotNull
List> getValues(String fieldName) throws IllegalArgumentException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field, using
* {@link #field(String)} for lookup.
*
* The {@link Converter} that is provided by
* {@link Configuration#converterProvider()} will be used to convert the
* value to U
*
* @param fieldName The values' field name
* @param type The type used for type conversion
* @return The values
* @see Record#get(String, Class)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
@NotNull
List getValues(String fieldName, Class extends U> type) throws IllegalArgumentException, DataTypeException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field, using
* {@link #field(String)} for lookup.
*
* @param fieldName The values' field name
* @param converter The data type converter used for type conversion
* @return The values
* @see Record#get(String, Converter)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
@NotNull
List getValues(String fieldName, Converter, ? extends U> converter)
throws IllegalArgumentException, DataTypeException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field, using
* {@link #field(Name)} for lookup.
*
* @param fieldName The values' field name
* @return The values
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
*/
@NotNull
List> getValues(Name fieldName) throws IllegalArgumentException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field, using
* {@link #field(Name)} for lookup.
*
* The {@link Converter} that is provided by
* {@link Configuration#converterProvider()} will be used to convert the
* value to U
*
* @param fieldName The values' field name
* @param type The type used for type conversion
* @return The values
* @see Record#get(Name, Class)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
@NotNull
List getValues(Name fieldName, Class extends U> type) throws IllegalArgumentException, DataTypeException;
/**
* Convenience method to fetch all values for a given field. This is
* especially useful, when selecting only a single field, using
* {@link #field(Name)} for lookup.
*
* @param fieldName The values' field name
* @param converter The data type converter used for type conversion
* @return The values
* @see Record#get(Name, Converter)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
@NotNull
List getValues(Name fieldName, Converter, ? extends U> converter)
throws IllegalArgumentException, DataTypeException;
/**
* Whether there are any records contained in this Result
.
*/
@Override
boolean isEmpty();
/**
* Whether there are any records contained in this Result
.
*/
boolean isNotEmpty();
/**
* Collect all records of this result.
*
* This is the same as calling {@link Stream#collect(Collector)} on
* {@link #stream()}.
*/
X collect(Collector super R, A, X> collector);
/**
* Return the generated result as a list of name/value maps.
*
* @return The result.
* @see Record#intoMap()
*/
@NotNull
List> intoMaps();
/**
* Return a {@link Map} with one of the result's columns as key and the
* corresponding records as value, using {@link #field(Field)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the key turns out to be
* non-unique in the result set. Use {@link #intoGroups(Field)} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param The key's generic field type.
* @param key The key field. Client code must assure that this field is
* unique in the result set.
* @return A Map containing the results.
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
* @throws InvalidResultException if the key field returned two or more
* equal values from the result set.
*/
@NotNull
Map intoMap(Field key) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with one of the result's columns as key and the
* corresponding records as value.
*
* An {@link InvalidResultException} is thrown, if the key turns out to be
* non-unique in the result set. Use {@link #intoGroups(int)} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndex The 0-based key field index. Client code must assure
* that this field is unique in the result set.
* @return A Map containing the results
* @throws IllegalArgumentException If the argument keyFieldIndex is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key field returned two or more
* equal values from the result set.
*/
@NotNull
Map, R> intoMap(int keyFieldIndex) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with one of the result's columns as key and the
* corresponding records as value, using {@link #field(String)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the key turns out to be
* non-unique in the result set. Use {@link #intoGroups(String)} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name. Client code must assure that this
* field is unique in the result set.
* @return A Map containing the results
* @throws IllegalArgumentException If the argument keyFieldName is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key field returned two or more
* equal values from the result set.
*/
@NotNull
Map, R> intoMap(String keyFieldName) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with one of the result's columns as key and the
* corresponding records as value, using {@link #field(Name)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the key turns out to be
* non-unique in the result set. Use {@link #intoGroups(Name)} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name. Client code must assure that this
* field is unique in the result set.
* @return A Map containing the results
* @throws IllegalArgumentException If the argument keyFieldName is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key field returned two or more
* equal values from the result set.
*/
@NotNull
Map, R> intoMap(Name keyFieldName) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with one of the result's columns as key and another
* one of the result's columns as value, using {@link #field(Field)} for
* lookup.
*
* An {@link InvalidResultException} is thrown, if the key turns out to be
* non-unique in the result set. Use {@link #intoGroups(Field, Field)}
* instead, if your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param The key's generic field type
* @param The value's generic field type
* @param key The key field. Client code must assure that this field is
* unique in the result set.
* @param value The value field
* @return A Map containing the results
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key field returned two or more
* equal values from the result set.
*/
@NotNull
Map intoMap(Field key, Field value) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with one of the result's columns as key and another
* one of the result's columns as value
*
* An {@link InvalidResultException} is thrown, if the key turns out to be
* non-unique in the result set. Use {@link #intoGroups(int, int)} instead,
* if your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndex The 0-based key field index. Client code must assure
* that this field is unique in the result set.
* @param valueFieldIndex The 0-based value field index
* @return A Map containing the results
* @throws IllegalArgumentException If any of the argument field indexes is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key field returned two or more
* equal values from the result set.
*/
@NotNull
Map, ?> intoMap(int keyFieldIndex, int valueFieldIndex) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with one of the result's columns as key and another
* one of the result's columns as value, using {@link #field(String)} for
* lookup.
*
* An {@link InvalidResultException} is thrown, if the key turns out to be
* non-unique in the result set. Use {@link #intoGroups(String, String)}
* instead, if your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name. Client code must assure that this
* field is unique in the result set.
* @param valueFieldName The value field name
* @return A Map containing the results
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key field returned two or more
* equal values from the result set.
*/
@NotNull
Map, ?> intoMap(String keyFieldName, String valueFieldName)
throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with one of the result's columns as key and another
* one of the result's columns as value, using {@link #field(Name)} for
* lookup.
*
* An {@link InvalidResultException} is thrown, if the key turns out to be
* non-unique in the result set. Use {@link #intoGroups(Name, Name)}
* instead, if your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name. Client code must assure that this
* field is unique in the result set.
* @param valueFieldName The value field name
* @return A Map containing the results
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key field returned two or more
* equal values from the result set.
*/
@NotNull
Map, ?> intoMap(Name keyFieldName, Name valueFieldName) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with results grouped by the given key and mapped
* into the given entity type, using {@link #field(Field)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the key is non-unique in
* the result set. Use {@link #intoGroups(Field, Class)} instead, if your
* key is non-unique.
*
* The resulting map is iteration order preserving.
*
* @param key The key. Client code must assure that key is unique in the
* result set.
* @param type The entity type.
* @return A Map containing the result.
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
* @throws InvalidResultException if the key is non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map intoMap(Field key, Class extends E> type)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped
* into the given entity type.
*
* An {@link InvalidResultException} is thrown, if the key is non-unique in
* the result set. Use {@link #intoGroups(int, Class)} instead, if your key
* is non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndex The 0-based key field index. Client code must assure
* that key is unique in the result set.
* @param type The entity type.
* @return A Map containing the result.
* @throws IllegalArgumentException If the argument field index is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key is non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(int keyFieldIndex, Class extends E> type)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped
* into the given entity type, using {@link #field(String)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the key is non-unique in
* the result set. Use {@link #intoGroups(String, Class)} instead, if your
* key is non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key. Client code must assure that key is unique
* in the result set.
* @param type The entity type.
* @return A Map containing the result.
* @throws IllegalArgumentException If the argument field name is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key is non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(String keyFieldName, Class extends E> type)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped
* into the given entity type, using {@link #field(Name)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the key is non-unique in
* the result set. Use {@link #intoGroups(Name, Class)} instead, if your key
* is non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key. Client code must assure that key is unique
* in the result set.
* @param type The entity type.
* @return A Map containing the result.
* @throws IllegalArgumentException If the argument field name is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key is non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(Name keyFieldName, Class extends E> type)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped by
* the given mapper, using {@link #field(Field)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the key is non-unique in
* the result set. Use {@link #intoGroups(Field, Class)} instead, if your
* key is non-unique.
*
* The resulting map is iteration order preserving.
*
* @param key The key. Client code must assure that key is unique in the
* result set.
* @param mapper The mapper callback.
* @return A Map containing the result.
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
* @throws InvalidResultException if the key is non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map intoMap(Field key, RecordMapper super R, E> mapper)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped by
* the given mapper.
*
* An {@link InvalidResultException} is thrown, if the key is non-unique in
* the result set. Use {@link #intoGroups(int, Class)} instead, if your key
* is non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndex The 0-based key field index. Client code must assure
* that key is unique in the result set.
* @param mapper The mapper callback.
* @return A Map containing the result.
* @throws IllegalArgumentException If the argument field index is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key is non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(int keyFieldIndex, RecordMapper super R, E> mapper)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped by
* the given mapper, using {@link #field(String)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the key is non-unique in
* the result set. Use {@link #intoGroups(String, Class)} instead, if your
* key is non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key. Client code must assure that key is unique
* in the result set.
* @param mapper The mapper callback.
* @return A Map containing the result.
* @throws IllegalArgumentException If the argument field name is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key is non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(String keyFieldName, RecordMapper super R, E> mapper)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped by
* the given mapper, using {@link #field(Name)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the key is non-unique in
* the result set. Use {@link #intoGroups(Name, Class)} instead, if your key
* is non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key. Client code must assure that key is unique
* in the result set.
* @param mapper The mapper callback.
* @return A Map containing the result.
* @throws IllegalArgumentException If the argument field name is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the key is non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(Name keyFieldName, RecordMapper super R, E> mapper)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with the given keys as a map key and the
* corresponding record as value, using {@link #field(Field)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Field[])} instead, if your keys
* are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keys The keys. Client code must assure that keys are unique in the
* result set. If this is null
or an empty array,
* the resulting map will contain at most one entry.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
*/
@NotNull
Map intoMap(Field>[] keys) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with the given keys as a map key and the
* corresponding record as value.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(int[])} instead, if your keys
* are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndexes The 0-based key field indexes. Client code must
* assure that keys are unique in the result set. If this is
* null
or an empty array, the resulting map will
* contain at most one entry.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field indexes is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
*/
@NotNull
Map intoMap(int[] keyFieldIndexes) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with the given keys as a map key and the
* corresponding record as value, using {@link #field(String)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(String[])} instead, if your
* keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. Client code must assure that keys are
* unique in the result set. If this is null
or an
* empty array, the resulting map will contain at most one entry.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
*/
@NotNull
Map intoMap(String[] keyFieldNames) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with the given keys as a map key and the
* corresponding record as value, using {@link #field(Name)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Name[])} instead, if your keys
* are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. Client code must assure that keys are
* unique in the result set. If this is null
or an
* empty array, the resulting map will contain at most one entry.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
*/
@NotNull
Map intoMap(Name[] keyFieldNames) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with the given keys as a map key and the
* corresponding record as value, using {@link #field(Field)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Field[], Field[])} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keys The keys. Client code must assure that keys are unique in the
* result set. If this is null
or an empty array,
* the resulting map will contain at most one entry.
* @param values The values.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
*/
@NotNull
Map intoMap(Field>[] keys, Field>[] values)
throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with the given keys as a map key and the
* corresponding record as value.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(int[], int[])} instead, if your
* keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndexes The 0-based key field indexes. Client code must
* assure that keys are unique in the result set. If this is
* null
or an empty array, the resulting map will
* contain at most one entry.
* @param valueFieldIndexes The values.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field indexes is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
*/
@NotNull
Map intoMap(int[] keyFieldIndexes, int[] valueFieldIndexes)
throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with the given keys as a map key and the
* corresponding record as value, using {@link #field(String)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(String[], String[])} instead,
* if your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. Client code must assure that keys are
* unique in the result set. If this is null
or an
* empty array, the resulting map will contain at most one entry.
* @param valueFieldNames The values.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
*/
@NotNull
Map intoMap(String[] keyFieldNames, String[] valueFieldNames)
throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with the given keys as a map key and the
* corresponding record as value, using {@link #field(Name)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Name[], Name[])} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. Client code must assure that keys are
* unique in the result set. If this is null
or an
* empty array, the resulting map will contain at most one entry.
* @param valueFieldNames The values.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
*/
@NotNull
Map intoMap(Name[] keyFieldNames, Name[] valueFieldNames)
throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type, using {@link #field(Field)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Field[], Class)} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keys The keys. Client code must assure that keys are unique in the
* result set. If this is null
or an empty array,
* the resulting map will contain at most one entry.
* @param type The entity type.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(Field>[] keys, Class extends E> type)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(int[], Class)} instead, if your
* keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndexes The 0-based key field indexes. Client code must
* assure that keys are unique in the result set. If this is
* null
or an empty array, the resulting map will
* contain at most one entry.
* @param type The entity type.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field indexes is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(int[] keyFieldIndexes, Class extends E> type)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type, using {@link #field(String)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(String[], Class)} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. Client code must assure that keys are
* unique in the result set. If this is null
or an
* empty array, the resulting map will contain at most one entry.
* @param type The entity type.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(String[] keyFieldNames, Class extends E> type)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type, using {@link #field(Name)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Name[], Class)} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. Client code must assure that keys are
* unique in the result set. If this is null
or an
* empty array, the resulting map will contain at most one entry.
* @param type The entity type.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(Name[] keyFieldNames, Class extends E> type)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped by
* the given mapper, using {@link #field(Field)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Field[], Class)} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keys The keys. Client code must assure that keys are unique in the
* result set. If this is null
or an empty array,
* the resulting map will contain at most one entry.
* @param mapper The mapper callback.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(Field>[] keys, RecordMapper super R, E> mapper)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped by
* the given mapper.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(int[], Class)} instead, if your
* keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndexes The 0-based key field indexes. Client code must
* assure that keys are unique in the result set. If this is
* null
or an empty array, the resulting map will
* contain at most one entry.
* @param mapper The mapper callback.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field indexes is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(int[] keyFieldIndexes, RecordMapper super R, E> mapper)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped by
* the given mapper, using {@link #field(String)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(String[], Class)} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. Client code must assure that keys are
* unique in the result set. If this is null
or an
* empty array, the resulting map will contain at most one entry.
* @param mapper The mapper callback.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(String[] keyFieldNames, RecordMapper super R, E> mapper)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped by
* the given mapper, using {@link #field(Name)} for lookup.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Name[], Class)} instead, if
* your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. Client code must assure that keys are
* unique in the result set. If this is null
or an
* empty array, the resulting map will contain at most one entry.
* @param mapper The mapper callback.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, E> intoMap(Name[] keyFieldNames, RecordMapper super R, E> mapper)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key entity.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Class)} instead, if your keys
* are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyType The key type. If this is null
, the resulting
* map will contain at most one entry.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @see DefaultRecordMapper
*/
@NotNull
Map intoMap(Class extends K> keyType) throws MappingException, InvalidResultException;
/**
* Return a {@link Map} with results grouped by the given key entity and
* mapped into the given entity type.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Class, Class)} instead, if your
* keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyType The key type. If this is null
, the resulting
* map will contain at most one entry.
* @param valueType The value type.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @see DefaultRecordMapper
*/
@NotNull
Map intoMap(Class extends K> keyType, Class extends V> valueType)
throws MappingException, InvalidResultException;
/**
* Return a {@link Map} with results grouped by the given key entity and
* mapped into the given entity type.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Class, RecordMapper)} instead,
* if your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyType The key type. If this is null
, the resulting
* map will contain at most one entry.
* @param valueMapper The value mapper.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @see DefaultRecordMapper
*/
@NotNull
Map intoMap(Class extends K> keyType, RecordMapper super R, V> valueMapper)
throws InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key entity and
* mapped into the given entity type.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(RecordMapper)} instead, if your
* keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyMapper The key mapper.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @see DefaultRecordMapper
*/
@NotNull
Map intoMap(RecordMapper super R, K> keyMapper) throws InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key entity and
* mapped into the given entity type.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(RecordMapper, Class)} instead,
* if your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyMapper The key mapper.
* @param valueType The value type.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @see DefaultRecordMapper
*/
@NotNull
Map intoMap(RecordMapper super R, K> keyMapper, Class valueType)
throws InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key entity and
* mapped into the given entity type.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(RecordMapper, RecordMapper)}
* instead, if your keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyMapper The key mapper.
* @param valueMapper The value mapper.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @see DefaultRecordMapper
*/
@NotNull
Map intoMap(RecordMapper super R, K> keyMapper, RecordMapper super R, V> valueMapper)
throws InvalidResultException, MappingException;
/**
* Return a {@link Map} with the given key table as a map key and the
* corresponding record as value.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Table)} instead, if your keys
* are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param table The key table. Client code must assure that keys are unique
* in the result set. May not be null
.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
*/
@NotNull
Map intoMap(Table table) throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with the given key table as a map key and the
* corresponding record as value.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Table, Table)} instead, if your
* keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param keyTable The key table. Client code must assure that keys are
* unique in the result set. May not be null
.
* @param valueTable The value table. May not be null
.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
*/
@NotNull
Map intoMap(Table keyTable, Table valueTable)
throws IllegalArgumentException, InvalidResultException;
/**
* Return a {@link Map} with results grouped by the given key table and
* mapped into the given entity type.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Table, Class)} instead, if your
* keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param table The key table. Client code must assure that keys are unique
* in the result set. May not be null
.
* @param type The entity type.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map intoMap(Table table, Class extends E> type)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key table and
* mapped by the given mapper.
*
* An {@link InvalidResultException} is thrown, if the keys are non-unique
* in the result set. Use {@link #intoGroups(Table, Class)} instead, if your
* keys are non-unique.
*
* The resulting map is iteration order preserving.
*
* @param table The key table. Client code must assure that keys are unique
* in the result set. May not be null
.
* @param mapper The mapper callback.
* @return A Map containing the results.
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws InvalidResultException if the keys are non-unique in the result
* set.
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map intoMap(Table table, RecordMapper super R, E> mapper)
throws IllegalArgumentException, InvalidResultException, MappingException;
/**
* Return a {@link Map} with one of the result's columns as key and a list
* of corresponding records as value, using {@link #field(Field)} for
* lookup.
*
* Unlike {@link #intoMap(Field)}, this method allows for non-unique keys in
* the result set.
*
* The resulting map is iteration order preserving.
*
* @param The key's generic field type
* @param key The key field.
* @return A Map containing the results
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(Field key) throws IllegalArgumentException;
/**
* Return a {@link Map} with one of the result's columns as key and a list
* of corresponding records as value.
*
* Unlike {@link #intoMap(int)}, this method allows for non-unique keys in
* the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndex The 0-based key field index.
* @return A Map containing the results
* @throws IllegalArgumentException If the argument field index is not
* contained in {@link #fieldsRow()}
*/
@NotNull
Map, Result> intoGroups(int keyFieldIndex) throws IllegalArgumentException;
/**
* Return a {@link Map} with one of the result's columns as key and a list
* of corresponding records as value, using {@link #field(String)} for
* lookup.
*
* Unlike {@link #intoMap(String)}, this method allows for non-unique keys
* in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name.
* @return A Map containing the results
* @throws IllegalArgumentException If the argument field name is not
* contained in {@link #fieldsRow()}
*/
@NotNull
Map, Result> intoGroups(String keyFieldName) throws IllegalArgumentException;
/**
* Return a {@link Map} with one of the result's columns as key and a list
* of corresponding records as value, using {@link #field(Name)} for lookup.
*
* Unlike {@link #intoMap(Name)}, this method allows for non-unique keys in
* the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name.
* @return A Map containing the results
* @throws IllegalArgumentException If the argument field name is not
* contained in {@link #fieldsRow()}
*/
@NotNull
Map, Result> intoGroups(Name keyFieldName) throws IllegalArgumentException;
/**
* Return a {@link Map} with one of the result's columns as key and another
* one of the result's columns as value, using {@link #field(Field)} for
* lookup.
*
* Unlike {@link #intoMap(Field, Field)}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param The key's generic field type
* @param The value's generic field type
* @param key The key field.
* @param value The value field
* @return A Map containing the results
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(Field key, Field value) throws IllegalArgumentException;
/**
* Return a {@link Map} with one of the result's columns as key and another
* one of the result's columns as value.
*
* Unlike {@link #intoMap(int, int)}, this method allows for non-unique keys
* in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndex The 0-based key field index.
* @param valueFieldIndex The 0-based value field index.
* @return A Map containing the results
* @throws IllegalArgumentException If any of the argument field indexes is
* not contained in {@link #fieldsRow()}
*/
@NotNull
Map, List>> intoGroups(int keyFieldIndex, int valueFieldIndex) throws IllegalArgumentException;
/**
* Return a {@link Map} with one of the result's columns as key and another
* one of the result's columns as value, using {@link #field(String)} for
* lookup.
*
* Unlike {@link #intoMap(String, String)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name.
* @param valueFieldName The value field name.
* @return A Map containing the results
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
*/
@NotNull
Map, List>> intoGroups(String keyFieldName, String valueFieldName) throws IllegalArgumentException;
/**
* Return a {@link Map} with one of the result's columns as key and another
* one of the result's columns as value, using {@link #field(Name)} for
* lookup.
*
* Unlike {@link #intoMap(Name, Name)}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name.
* @param valueFieldName The value field name.
* @return A Map containing the results
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
*/
@NotNull
Map, List>> intoGroups(Name keyFieldName, Name valueFieldName) throws IllegalArgumentException;
/**
* Return a {@link Map} with results grouped by the given key and mapped
* into the given entity type, using {@link #field(Field)} for lookup.
*
* Unlike {@link #intoMap(Field, Class)}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param The key's generic field type
* @param The generic entity type.
* @param key The key field.
* @param type The entity type.
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(Field key, Class extends E> type)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped
* into the given entity type.
*
* Unlike {@link #intoMap(int, Class)}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndex The 0-based key field index.
* @param type The entity type.
* @throws IllegalArgumentException If the argument field index is not
* contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, List> intoGroups(int keyFieldIndex, Class extends E> type)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped
* into the given entity type, using {@link #field(String)} for lookup.
*
* Unlike {@link #intoMap(String, Class)}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name.
* @param type The entity type.
* @throws IllegalArgumentException If the argument field name is not
* contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, List> intoGroups(String keyFieldName, Class extends E> type)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped
* into the given entity type, using {@link #field(Name)} for lookup.
*
* Unlike {@link #intoMap(Name, Class)}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name.
* @param type The entity type.
* @throws IllegalArgumentException If the argument field name is not
* contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map, List> intoGroups(Name keyFieldName, Class extends E> type)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped by
* the given mapper, using {@link #field(Field)} for lookup.
*
* Unlike {@link #intoMap(Field, RecordMapper)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param The key's generic field type
* @param The generic entity type.
* @param key The key field.
* @param mapper The mapper callback.
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
*/
@NotNull
Map> intoGroups(Field key, RecordMapper super R, E> mapper)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped by
* the given mapper.
*
* Unlike {@link #intoMap(int, RecordMapper)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndex The 0-based key field index.
* @param mapper The mapper callback.
* @throws IllegalArgumentException If the argument field index is not
* contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
*/
@NotNull
Map, List> intoGroups(int keyFieldIndex, RecordMapper super R, E> mapper)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped by
* the given mapper, using {@link #field(String)} for lookup.
*
* Unlike {@link #intoMap(String, RecordMapper)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name.
* @param mapper The mapper callback.
* @throws IllegalArgumentException If the argument field name is not
* contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
*/
@NotNull
Map, List> intoGroups(String keyFieldName, RecordMapper super R, E> mapper)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key and mapped by
* the given mapper, using {@link #field(Name)} for lookup.
*
* Unlike {@link #intoMap(Name, RecordMapper)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldName The key field name.
* @param mapper The mapper callback.
* @throws IllegalArgumentException If the argument field name is not
* contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
*/
@NotNull
Map, List> intoGroups(Name keyFieldName, RecordMapper super R, E> mapper)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with the result grouped by the given keys, using
* {@link #field(Field)} for lookup.
*
* Unlike {@link #intoMap(Field[])}, this method allows for non-unique keys
* in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keys The keys. If this is null
or an empty array, the
* resulting map will contain at most one entry.
* @return A Map containing grouped results
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(Field>[] keys) throws IllegalArgumentException;
/**
* Return a {@link Map} with the result grouped by the given keys.
*
* Unlike {@link #intoMap(int[])}, this method allows for non-unique keys in
* the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndexes The 0-based key field indexes. If this is
* null
or an empty array, the resulting map will
* contain at most one entry.
* @return A Map containing grouped results
* @throws IllegalArgumentException If any of the argument field indexes is
* not contained in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(int[] keyFieldIndexes) throws IllegalArgumentException;
/**
* Return a {@link Map} with the result grouped by the given keys, using
* {@link #field(String)} for lookup.
*
* Unlike {@link #intoMap(String[])}, this method allows for non-unique keys
* in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. If this is null
or an empty
* array, the resulting map will contain at most one entry.
* @return A Map containing grouped results
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(String[] keyFieldNames) throws IllegalArgumentException;
/**
* Return a {@link Map} with the result grouped by the given keys, using
* {@link #field(Name)} for lookup.
*
* Unlike {@link #intoMap(Name[])}, this method allows for non-unique keys
* in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. If this is null
or an empty
* array, the resulting map will contain at most one entry.
* @return A Map containing grouped results
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(Name[] keyFieldNames) throws IllegalArgumentException;
/**
* Return a {@link Map} with the result grouped by the given keys, using
* {@link #field(Field)} for lookup.
*
* Unlike {@link #intoMap(Field[], Field[])}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keys The keys. If this is null
or an empty array, the
* resulting map will contain at most one entry.
* @param values The values.
* @return A Map containing grouped results
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(Field>[] keys, Field>[] values) throws IllegalArgumentException;
/**
* Return a {@link Map} with the result grouped by the given keys.
*
* Unlike {@link #intoMap(int[], int[])}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndexes The 0-based key field indexes. If this is
* null
or an empty array, the resulting map will
* contain at most one entry.
* @param valueFieldIndexes The 0-based value field indexes.
* @return A Map containing grouped results
* @throws IllegalArgumentException If any of the argument field indexes is
* not contained in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(int[] keyFieldIndexes, int[] valueFieldIndexes)
throws IllegalArgumentException;
/**
* Return a {@link Map} with the result grouped by the given keys, using
* {@link #field(String)} for lookup.
*
* Unlike {@link #intoMap(String[], String[])}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. If this is null
or an empty
* array, the resulting map will contain at most one entry.
* @param valueFieldNames The values.
* @return A Map containing grouped results
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(String[] keyFieldNames, String[] valueFieldNames)
throws IllegalArgumentException;
/**
* Return a {@link Map} with the result grouped by the given keys, using
* {@link #field(Name)} for lookup.
*
* Unlike {@link #intoMap(Name[], Name[])}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. If this is null
or an empty
* array, the resulting map will contain at most one entry.
* @param valueFieldNames The values.
* @return A Map containing grouped results
* @throws IllegalArgumentException If any of the argument field names is
* not contained in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(Name[] keyFieldNames, Name[] valueFieldNames)
throws IllegalArgumentException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type, using {@link #field(Field)} for lookup.
*
* Unlike {@link #intoMap(Field[], Class)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keys The keys. If this is null
or an empty array, the
* resulting map will contain at most one entry.
* @param type The entity type.
* @return A Map containing grouped results
* @throws IllegalArgumentException If the any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(Field>[] keys, Class extends E> type)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type.
*
* Unlike {@link #intoMap(int[], Class)}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndexes The 0-based key field indexes. If this is
* null
or an empty array, the resulting map will
* contain at most one entry.
* @param type The entity type.
* @return A Map containing grouped results
* @throws IllegalArgumentException If the any of the argument field indexes
* is not contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(int[] keyFieldIndexes, Class extends E> type)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type, using {@link #field(String)} for lookup.
*
* Unlike {@link #intoMap(String[], Class)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. If this is null
or an empty
* array, the resulting map will contain at most one entry.
* @param type The entity type.
* @return A Map containing grouped results
* @throws IllegalArgumentException If the any of the argument field names
* is not contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(String[] keyFieldNames, Class extends E> type)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type, using {@link #field(Name)} for lookup.
*
* Unlike {@link #intoMap(Name[], Class)}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. If this is null
or an empty
* array, the resulting map will contain at most one entry.
* @param type The entity type.
* @return A Map containing grouped results
* @throws IllegalArgumentException If the any of the argument field names
* is not contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(Name[] keyFieldNames, Class extends E> type)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type, using {@link #field(Field)} for lookup.
*
* Unlike {@link #intoMap(Field[], RecordMapper)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keys The keys. If this is null
or an empty array, the
* resulting map will contain at most one entry.
* @param mapper The mapper callback.
* @return A Map containing grouped results
* @throws IllegalArgumentException If the any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(Field>[] keys, RecordMapper super R, E> mapper)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type.
*
* Unlike {@link #intoMap(int[], RecordMapper)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldIndexes The 0-based key field indexes. If this is
* null
or an empty array, the resulting map will
* contain at most one entry.
* @param mapper The mapper callback.
* @return A Map containing grouped results
* @throws IllegalArgumentException If the any of the argument field indexes
* is not contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(int[] keyFieldIndexes, RecordMapper super R, E> mapper)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type, using {@link #field(String)} for lookup.
*
* Unlike {@link #intoMap(String[], RecordMapper)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. If this is null
or an empty
* array, the resulting map will contain at most one entry.
* @param mapper The mapper callback.
* @return A Map containing grouped results
* @throws IllegalArgumentException If the any of the argument field indexes
* is not contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(String[] keyFieldNames, RecordMapper super R, E> mapper)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given keys and mapped
* into the given entity type, using {@link #field(Name)} for lookup.
*
* Unlike {@link #intoMap(Name[], RecordMapper)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyFieldNames The keys. If this is null
or an empty
* array, the resulting map will contain at most one entry.
* @param mapper The mapper callback.
* @return A Map containing grouped results
* @throws IllegalArgumentException If the any of the argument field indexes
* is not contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(Name[] keyFieldNames, RecordMapper super R, E> mapper)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key entity.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* Unlike {@link #intoMap(Class)}, this method allows for non-unique keys in
* the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyType The key type. If this is null
, the resulting
* map will contain at most one entry.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(Class extends K> keyType) throws MappingException;
/**
* Return a {@link Map} with results grouped by the given key entity and
* mapped into the given entity type.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* Unlike {@link #intoMap(Class, Class)}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyType The key type. If this is null
, the resulting
* map will contain at most one entry.
* @param valueType The value type.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(Class extends K> keyType, Class extends V> valueType) throws MappingException;
/**
* Return a {@link Map} with results grouped by the given key entity and
* mapped into the given entity type.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* Unlike {@link #intoMap(Class, RecordMapper)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyType The key type. If this is null
, the resulting
* map will contain at most one entry.
* @param valueMapper The value mapper.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(Class extends K> keyType, RecordMapper super R, V> valueMapper)
throws MappingException;
/**
* Return a {@link Map} with results grouped by the given key entity and
* mapped into the given entity type.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* Unlike {@link #intoMap(RecordMapper, RecordMapper)}, this method allows
* for non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyMapper The key mapper.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(RecordMapper super R, K> keyMapper) throws MappingException;
/**
* Return a {@link Map} with results grouped by the given key entity and
* mapped into the given entity type.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* Unlike {@link #intoMap(RecordMapper, Class)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyMapper The key mapper.
* @param valueType The value type.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(RecordMapper super R, K> keyMapper, Class valueType) throws MappingException;
/**
* Return a {@link Map} with results grouped by the given key entity and
* mapped into the given entity type.
*
* The grouping semantics is governed by the key type's
* {@link Object#equals(Object)} and {@link Object#hashCode()}
* implementation, not necessarily the values as fetched from the database.
*
* Unlike {@link #intoMap(RecordMapper, RecordMapper)}, this method allows
* for non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyMapper The key mapper.
* @param valueMapper The value mapper.
* @return A Map containing grouped results
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(RecordMapper super R, K> keyMapper, RecordMapper super R, V> valueMapper)
throws MappingException;
/**
* Return a {@link Map} with the result grouped by the given key table.
*
* Unlike {@link #intoMap(Table)}, this method allows for non-unique keys in
* the result set.
*
* The resulting map is iteration order preserving.
*
* @param table The key table. May not be null
.
* @return A Map containing grouped results
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(Table table) throws IllegalArgumentException;
/**
* Return a {@link Map} with the result grouped by the given key table.
*
* Unlike {@link #intoMap(Table, Table)}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param keyTable The key table. May not be null
.
* @param valueTable The value table. May not be null
.
* @return A Map containing grouped results
* @throws IllegalArgumentException If any of the argument fields is not
* contained in {@link #fieldsRow()}
*/
@NotNull
Map> intoGroups(Table keyTable, Table valueTable)
throws IllegalArgumentException;
/**
* Return a {@link Map} with results grouped by the given key table and
* mapped into the given entity type.
*
* Unlike {@link #intoMap(Table, Class)}, this method allows for non-unique
* keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param table The key table. May not be null
.
* @param type The entity type.
* @return A Map containing grouped results
* @throws IllegalArgumentException If the any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(Table table, Class extends E> type)
throws IllegalArgumentException, MappingException;
/**
* Return a {@link Map} with results grouped by the given key table and
* mapped into the given entity type.
*
* Unlike {@link #intoMap(Table, RecordMapper)}, this method allows for
* non-unique keys in the result set.
*
* The resulting map is iteration order preserving.
*
* @param table The key table. May not be null
.
* @param mapper The mapper callback.
* @return A Map containing grouped results
* @throws IllegalArgumentException If the any of the argument fields is not
* contained in {@link #fieldsRow()}
* @throws MappingException wrapping any reflection or data type conversion
* exception that might have occurred while mapping records
* @see DefaultRecordMapper
*/
@NotNull
Map> intoGroups(Table table, RecordMapper super R, E> mapper)
throws IllegalArgumentException, MappingException;
/**
* Convert this result into an array of arrays.
*
* The resulting array has the same number of first-dimension elements as
* this result has records. It has the same number of second-dimension
* elements as this result's records have fields. The resulting array
* contains data as such:
*
*
*
*
* // For arbitrary values of i, j
* result.getValue(i, j) == result.intoArray()[i][j]
*
*
*
* @return This result as an array of arrays
* @see Record#intoArray()
*/
@Nullable
Object @NotNull [] @NotNull [] intoArrays();
/**
* Return all values for a field index from the result.
*
* You can access data like this
*
*
* result.intoArray(fieldIndex)[recordIndex]
*
*
* @param fieldIndex The 0-based field index
* @return The resulting values. This may be an array type more concrete
* than Object[]
, depending on whether jOOQ has any
* knowledge about fieldIndex
's actual type.
* @see #getValues(int)
* @throws IllegalArgumentException If the argument fieldIndex is not
* contained in {@link #fieldsRow()}
*/
@Nullable
Object @NotNull [] intoArray(int fieldIndex) throws IllegalArgumentException;
/**
* Return all values for a field index from the result.
*
* You can access data like this
*
*
* result.intoArray(fieldIndex)[recordIndex]
*
*
* @param fieldIndex The 0-based field index
* @return The resulting values.
* @see #getValues(int, Class)
* @throws IllegalArgumentException If the argument fieldIndex is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
U @NotNull [] intoArray(int fieldIndex, Class extends U> type)
throws IllegalArgumentException, DataTypeException;
/**
* Return all values for a field index from the result.
*
* You can access data like this
*
*
* result.intoArray(fieldIndex)[recordIndex]
*
*
* @param fieldIndex The 0-based field index
* @return The resulting values.
* @see #getValues(int, Converter)
* @throws IllegalArgumentException If the argument fieldIndex is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
U @NotNull [] intoArray(int fieldIndex, Converter, ? extends U> converter)
throws IllegalArgumentException, DataTypeException;
/**
* Return all values for a field name from the result, using
* {@link #field(String)} for lookup.
*
* You can access data like this
*
*
* result.intoArray(fieldName)[recordIndex]
*
*
* @return The resulting values. This may be an array type more concrete
* than Object[]
, depending on whether jOOQ has any
* knowledge about fieldName
's actual type.
* @see #getValues(String)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
*/
@Nullable
Object @NotNull [] intoArray(String fieldName) throws IllegalArgumentException;
/**
* Return all values for a field name from the result, using
* {@link #field(String)} for lookup.
*
* You can access data like this
*
*
* result.intoArray(fieldName)[recordIndex]
*
*
* @return The resulting values.
* @see #getValues(String, Class)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
U @NotNull [] intoArray(String fieldName, Class extends U> type)
throws IllegalArgumentException, DataTypeException;
/**
* Return all values for a field name from the result, using
* {@link #field(String)} for lookup.
*
* You can access data like this
*
*
* result.intoArray(fieldName)[recordIndex]
*
*
* @return The resulting values.
* @see #getValues(String, Converter)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
U @NotNull [] intoArray(String fieldName, Converter, ? extends U> converter)
throws IllegalArgumentException, DataTypeException;
/**
* Return all values for a field name from the result, using
* {@link #field(Name)} for lookup.
*
* You can access data like this
*
*
* result.intoArray(fieldName)[recordIndex]
*
*
* @return The resulting values. This may be an array type more concrete
* than Object[]
, depending on whether jOOQ has any
* knowledge about fieldName
's actual type.
* @see #getValues(Name)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
*/
@Nullable
Object @NotNull [] intoArray(Name fieldName) throws IllegalArgumentException;
/**
* Return all values for a field name from the result, using
* {@link #field(Name)} for lookup.
*
* You can access data like this
*
*
* result.intoArray(fieldName)[recordIndex]
*
*
* @return The resulting values.
* @see #getValues(Name, Class)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
U @NotNull [] intoArray(Name fieldName, Class extends U> type)
throws IllegalArgumentException, DataTypeException;
/**
* Return all values for a field name from the result, using
* {@link #field(Name)} for lookup.
*
* You can access data like this
*
*
* result.intoArray(fieldName)[recordIndex]
*
*
* @return The resulting values.
* @see #getValues(Name, Converter)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
U @NotNull [] intoArray(Name fieldName, Converter, ? extends U> converter)
throws IllegalArgumentException, DataTypeException;
/**
* Return all values for a field from the result, using
* {@link #field(Field)} for lookup.
*
* You can access data like this
*
*
* result.intoArray(field)[recordIndex]
*
*
* @return The resulting values.
* @see #getValues(Field)
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
*/
T @NotNull [] intoArray(Field field) throws IllegalArgumentException;
/**
* Return all values for a field from the result, using
* {@link #field(Field)} for lookup.
*
* You can access data like this
*
*
* result.intoArray(field)[recordIndex]
*
*
* @return The resulting values.
* @see #getValues(Field, Class)
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
U @NotNull [] intoArray(Field> field, Class extends U> type)
throws IllegalArgumentException, DataTypeException;
/**
* Return all values for a field from the result, using
* {@link #field(Field)} for lookup.
*
* You can access data like this
*
*
* result.intoArray(field)[recordIndex]
*
*
* @return The resulting values.
* @see #getValues(Field, Converter)
* @throws IllegalArgumentException If the argument field is not contained
* in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
U @NotNull [] intoArray(Field field, Converter super T, ? extends U> converter)
throws IllegalArgumentException, DataTypeException;
/**
* Map results into a custom mapper callback.
*
* @param mapper The mapper callback
* @return The custom mapped records
*/
@NotNull
Set intoSet(RecordMapper super R, E> mapper);
/**
* Return all values for a field index from the result.
*
* @param fieldIndex The 0-based field index
* @return The resulting values. This may be an array type more concrete
* than Object[]
, depending on whether jOOQ has any
* knowledge about fieldIndex
's actual type.
* @see #getValues(int)
* @throws IllegalArgumentException If the argument fieldIndex is not
* contained in {@link #fieldsRow()}
*/
@NotNull
Set> intoSet(int fieldIndex) throws IllegalArgumentException;
/**
* Return all values for a field index from the result.
*
* @param fieldIndex The 0-based field index
* @return The resulting values.
* @see #getValues(int, Class)
* @throws IllegalArgumentException If the argument fieldIndex is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
@NotNull
Set intoSet(int fieldIndex, Class extends U> type) throws IllegalArgumentException, DataTypeException;
/**
* Return all values for a field index from the result.
*
* @param fieldIndex The 0-based field index
* @return The resulting values.
* @see #getValues(int, Converter)
* @throws IllegalArgumentException If the argument fieldIndex is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
@NotNull
Set intoSet(int fieldIndex, Converter, ? extends U> converter)
throws IllegalArgumentException, DataTypeException;
/**
* Return all values for a field name from the result, using
* {@link #field(String)} for lookup.
*
* @return The resulting values. This may be an array type more concrete
* than Object[]
, depending on whether jOOQ has any
* knowledge about fieldName
's actual type.
* @see #getValues(String)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
*/
@NotNull
Set> intoSet(String fieldName) throws IllegalArgumentException;
/**
* Return all values for a field name from the result, using
* {@link #field(String)} for lookup.
*
* @return The resulting values.
* @see #getValues(String, Class)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
@NotNull
Set intoSet(String fieldName, Class extends U> type) throws IllegalArgumentException, DataTypeException;
/**
* Return all values for a field name from the result, using
* {@link #field(String)} for lookup.
*
* @return The resulting values.
* @see #getValues(String, Converter)
* @throws IllegalArgumentException If the argument fieldName is not
* contained in {@link #fieldsRow()}
* @throws DataTypeException wrapping any data type conversion exception
* that might have occurred
*/
@NotNull
Set intoSet(String fieldName, Converter, ? extends U> converter)
throws IllegalArgumentException, DataTypeException;
/**
* Return all values for a field name from the result, using
* {@link #field(Name)} for lookup.
*
* @return The resulting values. This may be an array type more concrete
* than