All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jooq.Result Maven / Gradle / Ivy

There is a newer version: 3.19.11
Show newest version
/**
 * Copyright (c) 2009-2016, Data Geekery GmbH (http://www.datageekery.com)
 * All rights reserved.
 *
 * 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.io.OutputStream;
import java.io.Writer;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.annotation.Generated;

import org.jooq.exception.DataAccessException;
import org.jooq.exception.DataTypeException;
import org.jooq.exception.IOException;
import org.jooq.exception.InvalidResultException;
import org.jooq.exception.MappingException;
import org.jooq.impl.DefaultRecordMapper;
import org.jooq.tools.Convert;

import org.w3c.dom.Document;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;

/**
 * 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 List, Attachable {

    /**
     * Get this result's record type.
     */
    RecordType recordType();

    /**
     * Get this result's fields as a {@link Row}.
     */
    Row fieldsRow();

    /**
     * Get a specific field from this Result.
     * 

* Usually, this will return the field itself. However, if this is a row * from an aliased table, the field will be aliased accordingly. * * @see Row#field(Field) */ Field field(Field field); /** * Get a specific field from this Result. * * @see Row#field(String) */ Field field(String name); /** * Get a specific field from this Result, coerced to type. * * @see Row#field(String, Class) */ Field field(String name, Class type); /** * Get a specific field from this Result, coerced to dataType. * * @see Row#field(String, DataType) */ Field field(String name, DataType dataType); /** * Get a specific field from this Result. * * @see Row#field(Name) */ Field field(Name name); /** * Get a specific field from this Result, coerced to type. * * @see Row#field(Name, Class) */ Field field(Name name, Class type); /** * Get a specific field from this Result, coerced to dataType. * * @see Row#field(Name, DataType) */ Field field(Name name, DataType dataType); /** * Get a specific field from this Result. * * @see Row#field(int) */ Field field(int index); /** * Get a specific field from this Result, coerced to type. * * @see Row#field(int, Class) */ Field field(int index, Class type); /** * Get a specific field from this Result, coerced to dataType. * * @see Row#field(int, DataType) */ Field field(int index, DataType dataType); /** * Get all fields from this Result. * * @see Row#fields() */ Field[] fields(); /** * Get all fields from this Result, providing some fields. * * @return All available fields * @see Row#fields(Field...) */ Field[] fields(Field... fields); /** * Get all fields from this Result, providing some field names. * * @return All available fields * @see Row#fields(String...) */ Field[] fields(String... fieldNames); /** * Get all fields from this Result, providing some field names. * * @return All available fields * @see Row#fields(Name...) */ Field[] fields(Name... fieldNames); /** * Get all fields from this Result, providing some field indexes. * * @return All available fields * @see Row#fields(int...) */ Field[] fields(int... fieldIndexes); /** * Convenience method to fetch a value at a given position in the result. * * @param The value's field's generic type parameter * @param index The record's index * @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 The value's field's generic type parameter * @param index The record's index * @param field The value's field * @param defaultValue The default value if the value was null * @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()} * @deprecated - 3.3.0 - [#2878] - This method will be removed in jOOQ 4.0 */ @Deprecated T getValue(int index, Field field, T defaultValue) throws IndexOutOfBoundsException, IllegalArgumentException; /** * Convenience method to fetch a value at a given position in the result. * * @param index The record's index * @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()} */ Object getValue(int index, int fieldIndex) throws IndexOutOfBoundsException, IllegalArgumentException; /** * Convenience method to fetch a value at a given position in the result. * * @param index The record's index * @param fieldIndex The value's field index * @param defaultValue The default value if the value was null * @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()} * @deprecated - 3.3.0 - [#2878] - This method will be removed in jOOQ 4.0 */ @Deprecated Object getValue(int index, int fieldIndex, Object defaultValue) throws IndexOutOfBoundsException, IllegalArgumentException; /** * Convenience method to fetch a value at a given position in the result. * * @param index The record's index * @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()} */ Object getValue(int index, String fieldName) throws IndexOutOfBoundsException, IllegalArgumentException; /** * Convenience method to fetch a value at a given position in the result. * * @param index The record's index * @param fieldName The value's field name * @param defaultValue The default value if the value was null * @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()} * @deprecated - 3.3.0 - [#2878] - This method will be removed in jOOQ 4.0 */ @Deprecated Object getValue(int index, String fieldName, Object defaultValue) throws IndexOutOfBoundsException, IllegalArgumentException; /** * Convenience method to fetch all values for a given field. This is * especially useful, when selecting only a single field. * * @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()} */ 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. * * @param field The values' field * @param type The type used for type conversion * @return The values * @see Record#get(Field, Class) * @see Convert#convert(Object, Class) * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ List getValues(Field field, Class type) throws IllegalArgumentException; /** * Convenience method to fetch all values for a given field. This is * especially useful, when selecting only a single field. * * @param field The values' field * @param converter The data type converter used for type conversion * @return The values * @see Record#get(Field, Converter) * @see Convert#convert(Object, Converter) * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ List getValues(Field field, Converter converter) throws IllegalArgumentException; /** * Convenience method to fetch all values for a given field. This is * especially useful, when selecting only a single field. * * @param fieldIndex The values' field index * @return The values * @throws IllegalArgumentException If the argument fieldIndex is not * contained in {@link #fieldsRow()} */ List getValues(int fieldIndex) throws IllegalArgumentException; /** * Convenience method to fetch all values for a given field. This is * especially useful, when selecting only a single field. * * @param fieldIndex The values' field index * @param type The type used for type conversion * @return The values * @see Record#get(int, Class) * @see Convert#convert(Object, 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 */ List getValues(int fieldIndex, Class 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 fieldIndex The values' field index * @param converter The data type converter used for type conversion * @return The values * @see Record#get(int, Converter) * @see Convert#convert(Object, 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 */ List getValues(int fieldIndex, Converter converter) throws IllegalArgumentException, DataTypeException; /** * Convenience method to fetch all values for a given field. This is * especially useful, when selecting only a single field. * * @param fieldName The values' field name * @return The values * @throws IllegalArgumentException If the argument fieldName is not * contained in {@link #fieldsRow()} */ 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. * * @param fieldName The values' field name * @param type The type used for type conversion * @return The values * @see Record#get(String, Class) * @see Convert#convert(Object, 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 */ List getValues(String fieldName, Class 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 fieldName The values' field name * @param converter The data type converter used for type conversion * @return The values * @see Record#get(String, Converter) * @see Convert#convert(Object, 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 */ List getValues(String fieldName, Converter converter) throws IllegalArgumentException, DataTypeException; /** * Convenience method to fetch all values for a given field. This is * especially useful, when selecting only a single field. * * @param fieldName The values' field name * @return The values * @throws IllegalArgumentException If the argument fieldName is not * contained in {@link #fieldsRow()} */ 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. * * @param fieldName The values' field name * @param type The type used for type conversion * @return The values * @see Record#get(Name, Class) * @see Convert#convert(Object, 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 */ List getValues(Name fieldName, Class 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 fieldName The values' field name * @param converter The data type converter used for type conversion * @return The values * @see Record#get(Name, Converter) * @see Convert#convert(Object, 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 */ List getValues(Name fieldName, Converter 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(); /** * Get a simple formatted representation of this result. *

* This is the same as calling {@link #format(int)} with * maxRows = 50 * * @return The formatted result */ String format(); /** * Get a simple formatted representation of this result. * * @param maxRecords The maximum number of records to include in the * formatted result * @return The formatted result */ String format(int maxRecords); /** * Get a simple formatted representation of this result as HTML. *

* The HTML code is formatted as follows:

     * <table>
     *   <thead>
     *     <tr>
     *       <th>field-1</th>
     *       <th>field-2</th>
     *       ...
     *       <th>field-n</th>
     *     </tr>
     *   </thead>
     *   <tbody>
     *     <tr>
     *       <th>value-1-1</th>
     *       <th>value-1-2</th>
     *       ...
     *       <th>value-1-n</th>
     *     </tr>
     *     <tr>
     *       <th>value-2-1</th>
     *       <th>value-2-2</th>
     *       ...
     *       <th>value-2-n</th>
     *     </tr>
     *     ...
     *   </tbody>
     * </table>
     * 
* * @return The formatted result */ String formatHTML(); /** * Get a simple formatted representation of this result as CSV. *

* This is the same as calling formatCSV(true, ',', "") * * @return The formatted result */ String formatCSV(); /** * Get a simple formatted representation of this result as CSV. *

* This is the same as calling formatCSV(true, delimiter, "") * * @param delimiter The delimiter to use between records * @return The formatted result */ String formatCSV(char delimiter); /** * Get a simple formatted representation of this result as CSV. *

* This is the same as calling formatCSV(true, delimiter, nullString) * * @param delimiter The delimiter to use between records * @param nullString A special string for encoding NULL values. * @return The formatted result */ String formatCSV(char delimiter, String nullString); /** * Get a simple formatted representation of this result as CSV. *

* This is the same as calling formatCSV(',', "") * * @param header Whether to emit a CSV header line * @return The formatted result */ String formatCSV(boolean header); /** * Get a simple formatted representation of this result as CSV. *

* This is the same as calling formatCSV(delimiter, "") * * @param header Whether to emit a CSV header line * @param delimiter The delimiter to use between records * @return The formatted result */ String formatCSV(boolean header, char delimiter); /** * Get a simple formatted representation of this result as CSV. * * @param header Whether to emit a CSV header line * @param delimiter The delimiter to use between records * @param nullString A special string for encoding NULL values. * @return The formatted result */ String formatCSV(boolean header, char delimiter, String nullString); /** * Get a simple formatted representation of this result as CSV. * * @return The formatted result */ String formatCSV(CSVFormat format); /** * Get a simple formatted representation of this result as a JSON array of * array. *

* The format is the following:

     * {"fields":[{"name":"field-1","type":"type-1"},
     *            {"name":"field-2","type":"type-2"},
     *            ...,
     *            {"name":"field-n","type":"type-n"}],
     *  "records":[[value-1-1,value-1-2,...,value-1-n],
     *             [value-2-1,value-2-2,...,value-2-n]]}
     * 
* * @return The formatted result */ String formatJSON(); /** * Get this result formatted as XML. * * @see http://www.jooq.org/xsd/jooq-export-2.6.0.xsd */ String formatXML(); /** * Get this result as a set of INSERT statements. *

* This uses the the first record's {@link TableRecord#getTable()}, if the * first record is a {@link TableRecord}. Otherwise, this generates * INSERT statements into an "UNKNOWN_TABLE". In * both cases, the {@link Result#fields()} are used for column names. */ String formatInsert(); /** * Get this result as a set of INSERT statements. *

* This explicitly specifies the table (and optionally the fields) to insert * into. If the fields argument is left empty, the * {@link Result#fields()} are used, instead. */ String formatInsert(Table table, Field... fields); /** * Like {@link #format()}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void format(OutputStream stream) throws IOException; /** * Like {@link #format(int)}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void format(OutputStream stream, int maxRecords) throws IOException; /** * Like {@link #formatHTML()}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatHTML(OutputStream stream) throws IOException; /** * Like {@link #formatCSV()}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(OutputStream stream) throws IOException; /** * Like {@link #formatCSV(char)}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(OutputStream stream, char delimiter) throws IOException; /** * Like {@link #formatCSV(char, String)}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(OutputStream stream, char delimiter, String nullString) throws IOException; /** * Like {@link #formatCSV(boolean)}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(OutputStream stream, boolean header) throws IOException; /** * Like {@link #formatCSV(boolean, char)}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(OutputStream stream, boolean header, char delimiter) throws IOException; /** * Like {@link #formatCSV(boolean, char, String)}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(OutputStream stream, boolean header, char delimiter, String nullString) throws IOException; /** * Like {@link #formatCSV(CSVFormat)}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(OutputStream stream, CSVFormat format) throws IOException; /** * Like {@link #formatJSON()}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatJSON(OutputStream stream) throws IOException; /** * Like {@link #formatXML()}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatXML(OutputStream stream) throws IOException; /** * Like {@link #formatInsert()}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatInsert(OutputStream stream) throws IOException; /** * Like {@link #formatInsert(Table, Field...)}, but the data is output onto an {@link OutputStream}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatInsert(OutputStream stream, Table table, Field... fields) throws IOException; /** * Like {@link #format()}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void format(Writer writer) throws IOException; /** * Like {@link #format(int)}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void format(Writer writer, int maxRecords) throws IOException; /** * Like {@link #formatHTML()}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatHTML(Writer writer) throws IOException; /** * Like {@link #formatCSV()}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(Writer writer) throws IOException; /** * Like {@link #formatCSV(char)}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(Writer writer, char delimiter) throws IOException; /** * Like {@link #formatCSV(char, String)}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(Writer writer, char delimiter, String nullString) throws IOException; /** * Like {@link #formatCSV(boolean)}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(Writer writer, boolean header) throws IOException; /** * Like {@link #formatCSV(boolean, char)}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(Writer writer, boolean header, char delimiter) throws IOException; /** * Like {@link #formatCSV(boolean, char, String)}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(Writer writer, boolean header, char delimiter, String nullString) throws IOException; /** * Like {@link #formatCSV(CSVFormat)}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatCSV(Writer writer, CSVFormat format) throws IOException; /** * Like {@link #formatJSON()}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatJSON(Writer writer) throws IOException; /** * Like {@link #formatXML()}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatXML(Writer writer) throws IOException; /** * Like {@link #formatInsert()}, but the data is output onto a {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatInsert(Writer writer) throws IOException; /** * Like {@link #formatInsert(Table, Field...)}, but the data is output onto an {@link Writer}. * * @throws IOException - an unchecked wrapper for {@link java.io.IOException}, if anything goes wrong. */ void formatInsert(Writer writer, Table table, Field... fields) throws IOException; /** * Get this result as XML. * * @see #formatXML() * @see http://www.jooq.org/xsd/jooq-export-2.6.0.xsd */ Document intoXML(); /** * Get this result as XML using a SAX ContentHandler. * * @param handler The custom content handler. * @return The argument content handler is returned for convenience. * @see #formatXML() * @see http://www.jooq.org/xsd/jooq-export-2.6.0.xsd */ H intoXML(H handler) throws SAXException; /** * Return the generated result as a list of name/value maps. * * @return The result. * @see Record#intoMap() */ List> intoMaps(); /** * 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(Field)} instead, if * your keys are non-unique * * @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. */ 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 * * @param keyFieldIndex The 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. */ Map 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. *

* 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 * * @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. */ Map 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. *

* 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 * * @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. */ Map 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 *

* 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 * * @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. */ 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 * * @param keyFieldIndex The key field index. Client code must assure that * this field is unique in the result set. * @param valueFieldIndex The 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. */ 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 *

* 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 * * @param key The key field name. Client code must assure that this field is * unique in the result set. * @param value 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. */ 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 *

* 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 * * @param key The key field name. Client code must assure that this field is * unique in the result set. * @param value 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. */ 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. *

* 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. * * @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 */ Map intoMap(Field key, Class 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. * * @param keyFieldIndex 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 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 */ Map intoMap(int keyFieldIndex, Class 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(String, Class)} instead, if your * key is non-unique. * * @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 */ Map intoMap(String keyFieldName, Class 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(Name, Class)} instead, if your * key is non-unique. * * @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 */ Map intoMap(Name keyFieldName, Class type) 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(Field, Class)} instead, if your * key is non-unique. * * @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 */ Map intoMap(Field key, RecordMapper 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. * * @param keyFieldIndex 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 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 */ Map intoMap(int keyFieldIndex, RecordMapper 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(String, Class)} instead, if your key * is non-unique. * * @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 */ Map intoMap(String keyFieldName, RecordMapper 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(Name, Class)} instead, if your key * is non-unique. * * @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 */ Map intoMap(Name keyFieldName, RecordMapper mapper) throws IllegalArgumentException, InvalidResultException, MappingException; /** * 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(Field[])} instead, if your keys * are non-unique. * * @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. */ 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. * * @param keyFieldIndexes 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 indexes is * not contained in {@link #fieldsRow()} * @throws InvalidResultException if the keys are non-unique in the result * set. */ 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. *

* 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. * * @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. */ 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. *

* 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. * * @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. */ Map intoMap(Name[] keyFieldNames) throws IllegalArgumentException, InvalidResultException; /** * 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(Field[], Class)} instead, if * your keys are non-unique. * * @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 */ Map, E> intoMap(Field[] keys, Class 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. * * @param keyFieldIndexes 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 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 */ Map, E> intoMap(int[] keyFieldIndexes, Class 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(String[], Class)} instead, if your * keys are non-unique. * * @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 */ Map, E> intoMap(String[] keyFieldNames, Class 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(Name[], Class)} instead, if your * keys are non-unique. * * @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 */ Map, E> intoMap(Name[] keyFieldNames, Class type) 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(Field[], Class)} instead, if * your keys are non-unique. * * @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 */ Map, E> intoMap(Field[] keys, RecordMapper 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. * * @param keyFieldIndexes 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 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 */ Map, E> intoMap(int[] keyFieldIndexes, RecordMapper 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(String[], Class)} instead, if * your keys are non-unique. * * @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 */ Map, E> intoMap(String[] keyFieldNames, RecordMapper 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(Name[], Class)} instead, if * your keys are non-unique. * * @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 */ Map, E> intoMap(Name[] keyFieldNames, RecordMapper 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. * * @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 */ Map intoMap(Class 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. * * @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 */ Map intoMap(Class keyType, Class 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. * * @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 */ Map intoMap(Class keyType, RecordMapper 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. * * @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 */ Map intoMap(RecordMapper 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. * * @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 */ Map intoMap(RecordMapper 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. * * @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 */ Map intoMap(RecordMapper keyMapper, RecordMapper 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. * * @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. */ Map intoMap(Table table) 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. * * @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 */ Map intoMap(Table table, Class 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. * * @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 */ Map intoMap(Table table, RecordMapper 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. *

* Unlike {@link #intoMap(Field)}, this method allows for non-unique keys in * the result set. * * @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()} */ 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. * * @param keyFieldIndex The key field index. * @return A Map containing the results * @throws IllegalArgumentException If the argument field index is not * contained in {@link #fieldsRow()} */ Map> 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. *

* Unlike {@link #intoMap(String)}, this method allows for non-unique keys in * the result set. * * @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()} */ Map> 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. *

* Unlike {@link #intoMap(Name)}, this method allows for non-unique keys in * the result set. * * @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()} */ Map> 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. *

* Unlike {@link #intoMap(Field, Field)}, this method allows for non-unique * keys in the result set. * * @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()} */ 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. * * @param keyFieldIndex The key field index. * @param valueFieldIndex The value field index. * @return A Map containing the results * @throws IllegalArgumentException If any of the argument field indexes is * not contained in {@link #fieldsRow()} */ Map> 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. *

* Unlike {@link #intoMap(String, String)}, this method allows for * non-unique keys in the result set. * * @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()} */ Map> 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. *

* Unlike {@link #intoMap(Name, Name)}, this method allows for * non-unique keys in the result set. * * @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()} */ Map> 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. *

* * @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 */ Map> intoGroups(Field key, Class type) throws IllegalArgumentException, MappingException; /** * Return a {@link Map} with results grouped by the given key and mapped * into the given entity type. *

* * @param keyFieldIndex The 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 */ Map> intoGroups(int keyFieldIndex, Class type) throws IllegalArgumentException, MappingException; /** * Return a {@link Map} with results grouped by the given key and mapped * into the given entity type. *

* * @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 */ Map> intoGroups(String keyFieldName, Class type) throws IllegalArgumentException, MappingException; /** * Return a {@link Map} with results grouped by the given key and mapped * into the given entity type. *

* * @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 */ Map> intoGroups(Name keyFieldName, Class type) throws IllegalArgumentException, MappingException; /** * Return a {@link Map} with results grouped by the given key and mapped by * the given mapper. * * @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 */ Map> intoGroups(Field key, RecordMapper mapper) throws IllegalArgumentException, MappingException; /** * Return a {@link Map} with results grouped by the given key and mapped by * the given mapper. * * @param keyFieldIndex The 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 */ Map> intoGroups(int keyFieldIndex, RecordMapper mapper) throws IllegalArgumentException, MappingException; /** * Return a {@link Map} with results grouped by the given key and mapped by * the given mapper. * * @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 */ Map> intoGroups(String keyFieldName, RecordMapper mapper) throws IllegalArgumentException, MappingException; /** * Return a {@link Map} with results grouped by the given key and mapped by * the given mapper. * * @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 */ Map> intoGroups(Name keyFieldName, RecordMapper mapper) throws IllegalArgumentException, MappingException; /** * Return a {@link Map} with the result grouped by the given keys. *

* Unlike {@link #intoMap(Field[])}, this method allows for non-unique keys * in the result set. * * @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()} */ 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. * * @param keyFieldIndexes 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 indexes is * not contained in {@link #fieldsRow()} */ Map> intoGroups(int[] keyFieldIndexes) throws IllegalArgumentException; /** * Return a {@link Map} with the result grouped by the given keys. *

* Unlike {@link #intoMap(String[])}, this method allows for non-unique keys * in the result set. * * @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()} */ Map> intoGroups(String[] keyFieldNames) throws IllegalArgumentException; /** * Return a {@link Map} with the result grouped by the given keys. *

* Unlike {@link #intoMap(Name[])}, this method allows for non-unique keys * in the result set. * * @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()} */ Map> intoGroups(Name[] keyFieldNames) throws IllegalArgumentException; /** * Return a {@link Map} with results grouped by the given keys and mapped * into the given entity type. *

* Unlike {@link #intoMap(Field[], Class)}, this method allows for * non-unique keys in the result set. * * @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 */ Map> intoGroups(Field[] keys, Class 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. * * @param keyFieldIndexes 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 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 */ Map> intoGroups(int[] keyFieldIndexes, Class 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(String[], Class)}, this method allows for * non-unique keys in the result set. * * @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 */ Map> intoGroups(String[] keyFieldNames, Class 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(Name[], Class)}, this method allows for * non-unique keys in the result set. * * @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 */ Map> intoGroups(Name[] keyFieldNames, Class 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(Field[], RecordMapper)}, this method allows for * non-unique keys in the result set. * * @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 */ Map> intoGroups(Field[] keys, RecordMapper 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. * * @param keyFieldIndexes 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 */ Map> intoGroups(int[] keyFieldIndexes, RecordMapper 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(String[], RecordMapper)}, this method allows for * non-unique keys in the result set. * * @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 */ Map> intoGroups(String[] keyFieldNames, RecordMapper 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(Name[], RecordMapper)}, this method allows for * non-unique keys in the result set. * * @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 */ Map> intoGroups(Name[] keyFieldNames, RecordMapper 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. * * @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 */ Map> intoGroups(Class 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. * * @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 */ Map> intoGroups(Class keyType, 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(Class, RecordMapper)}, this method allows for * non-unique keys in the result set. * * @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 */ Map> intoGroups(Class keyType, RecordMapper 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. * * @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 */ Map> intoGroups(RecordMapper 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. * * @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 */ Map> intoGroups(RecordMapper 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. * * @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 */ Map> intoGroups(RecordMapper keyMapper, RecordMapper 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. * * @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()} */ Map> intoGroups(Table table) 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. * * @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 */ Map> intoGroups(Table table, Class 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. * * @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 */ Map> intoGroups(Table table, RecordMapper mapper) throws IllegalArgumentException, MappingException; /** * @deprecated - 3.6.0 - [#3879] - Use {@link #intoArrays()} instead. */ @Deprecated Object[][] intoArray(); /** * 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() */ Object[][] intoArrays(); /** * Return all values for a field index from the result. *

* You can access data like this *

result.intoArray(fieldIndex)[recordIndex]
* * @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()} */ Object[] 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]
* * @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 */ T[] intoArray(int fieldIndex, Class type) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field index from the result. *

* You can access data like this *

result.intoArray(fieldIndex)[recordIndex]
* * @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[] intoArray(int fieldIndex, Converter converter) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field name from the result. *

* 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()} */ Object[] intoArray(String fieldName) throws IllegalArgumentException; /** * Return all values for a field name from the result. *

* 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 */ T[] intoArray(String fieldName, Class type) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field name from the result. *

* 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[] intoArray(String fieldName, Converter converter) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field name from the result. *

* 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()} */ Object[] intoArray(Name fieldName) throws IllegalArgumentException; /** * Return all values for a field name from the result. *

* 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 */ T[] intoArray(Name fieldName, Class type) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field name from the result. *

* 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[] intoArray(Name fieldName, Converter converter) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field from the result. *

* 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[] intoArray(Field field) throws IllegalArgumentException; /** * Return all values for a field from the result. *

* 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 */ T[] intoArray(Field field, Class type) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field from the result. *

* 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[] intoArray(Field field, Converter converter) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field index from the result. * * @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()} */ Set intoSet(int fieldIndex) throws IllegalArgumentException; /** * Return all values for a field index from the result. * * @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 */ Set intoSet(int fieldIndex, Class type) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field index from the result. * * @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 */ Set intoSet(int fieldIndex, Converter converter) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field name from the result. * * @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()} */ Set intoSet(String fieldName) throws IllegalArgumentException; /** * Return all values for a field name from the result. * * @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 */ Set intoSet(String fieldName, Class type) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field name from the result. * * @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 */ Set intoSet(String fieldName, Converter converter) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field name from the result. * * @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()} */ Set intoSet(Name fieldName) throws IllegalArgumentException; /** * Return all values for a field name from the result. * * @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 */ Set intoSet(Name fieldName, Class type) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field name from the result. * * @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 */ Set intoSet(Name fieldName, Converter converter) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field from the result. * * @return The resulting values. * @see #getValues(Field) * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Set intoSet(Field field) throws IllegalArgumentException; /** * Return all values for a field from the result. * * @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 */ Set intoSet(Field field, Class type) throws IllegalArgumentException, DataTypeException; /** * Return all values for a field from the result. * * @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 */ Set intoSet(Field field, Converter converter) throws IllegalArgumentException, DataTypeException; /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @param fields The fields of the new records * @return The new result */ Result into(Field... fields); // [jooq-tools] START [into-fields] /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20, Field field21); /** * Copy all records from this result into a new result with new records * holding only a subset of the previous fields. * * @return The new result */ @Generated("This class was generated using jOOQ-tools") Result> into(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20, Field field21, Field field22); // [jooq-tools] END [into-fields] /** * Map resulting records onto a custom type. *

* This is the same as calling record.into(type) on every * record contained in this Result. See * {@link Record#into(Class)} for more details * * @param The generic entity type. * @param type The entity type. * @throws MappingException wrapping any reflection or data type conversion * exception that might have occurred while mapping records * @see Record#into(Class) * @see DefaultRecordMapper */ List into(Class type) throws MappingException; /** * Map resulting records onto a custom record. *

* This is the same as calling record.into(table) on every * record contained in this Result. See * {@link Record#into(Table)} for more details * * @param The generic table record type. * @param table The table type. * @throws MappingException wrapping any reflection or data type conversion * exception that might have occurred while mapping records * @see Record#into(Table) */ Result into(Table table) throws MappingException; /** * Map results into a custom handler callback. * * @param handler The handler callback * @return Convenience result, returning the parameter handler itself */ > H into(H handler); /** * Generate an in-memory JDBC {@link ResultSet} containing the data of this * Result. *

* Use this as an adapter for JDBC-compliant code that expects a * {@link ResultSet} to operate on, rather than a jOOQ {@link Result}. The * returned ResultSet allows for the following behaviour * according to the JDBC specification: *

    *
  • {@link ResultSet#CLOSE_CURSORS_AT_COMMIT}: The cursors (i.e. * {@link Statement} object) are no longer available
  • *
  • {@link ResultSet#CONCUR_READ_ONLY}: You cannot update the database * through this ResultSet, as the underlying {@link Result} * object does not hold any open database refences anymore
  • *
  • {@link ResultSet#FETCH_FORWARD}: The fetch direction is forward only, * and cannot be changed
  • *
  • {@link ResultSet#TYPE_SCROLL_INSENSITIVE}: You can use any of the * ResultSet's scrolling methods, e.g. {@link ResultSet#next()} * or {@link ResultSet#previous()}, etc.
  • *
*

* You may use {@link DSLContext#fetch(ResultSet)} to unwind this wrapper * again. * * @return A wrapper JDBC ResultSet */ ResultSet intoResultSet(); /** * Map results into a custom mapper callback. * * @param mapper The mapper callback * @return The custom mapped records */ List map(RecordMapper mapper); /** * Sort this result by one of its contained fields. *

* nulls are sorted last by this method. * * @param field The sort field * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ > Result sortAsc(Field field) throws IllegalArgumentException; /** * Reverse-sort this result by one of its contained fields. *

* nulls are sorted last by this method. * * @param field The sort field * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ > Result sortDesc(Field field) throws IllegalArgumentException; /** * Sort this result by one of its contained fields. *

* nulls are sorted last by this method. * * @param fieldIndex The sort field index * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortAsc(int fieldIndex) throws IllegalArgumentException; /** * Reverse-sort this result by one of its contained fields. *

* nulls are sorted last by this method. * * @param fieldIndex The sort field index * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortDesc(int fieldIndex) throws IllegalArgumentException; /** * Sort this result by one of its contained fields. *

* nulls are sorted last by this method. * * @param fieldName The sort field name * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortAsc(String fieldName) throws IllegalArgumentException; /** * Reverse-sort this result by one of its contained fields. *

* nulls are sorted last by this method. * * @param fieldName The sort field name * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortDesc(String fieldName) throws IllegalArgumentException; /** * Sort this result by one of its contained fields. *

* nulls are sorted last by this method. * * @param fieldName The sort field name * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortAsc(Name fieldName) throws IllegalArgumentException; /** * Reverse-sort this result by one of its contained fields. *

* nulls are sorted last by this method. * * @param fieldName The sort field name * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortDesc(Name fieldName) throws IllegalArgumentException; /** * Sort this result by one of its contained fields using a comparator. *

* null sorting must be handled by the supplied * comparator. * * @param field The sort field * @param comparator The comparator used to sort this result. * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortAsc(Field field, java.util.Comparator comparator) throws IllegalArgumentException; /** * Reverse-sort this result by one of its contained fields using a * comparator. *

* null sorting must be handled by the supplied * comparator. * * @param field The sort field * @param comparator The comparator used to sort this result. * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortDesc(Field field, java.util.Comparator comparator) throws IllegalArgumentException; /** * Sort this result by one of its contained fields using a comparator. *

* null sorting must be handled by the supplied * comparator. * * @param fieldIndex The sort field index * @param comparator The comparator used to sort this result. * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortAsc(int fieldIndex, java.util.Comparator comparator) throws IllegalArgumentException; /** * Reverse-sort this result by one of its contained fields using a * comparator. *

* null sorting must be handled by the supplied * comparator. * * @param fieldIndex The sort field index * @param comparator The comparator used to sort this result. * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortDesc(int fieldIndex, java.util.Comparator comparator) throws IllegalArgumentException; /** * Sort this result by one of its contained fields using a comparator. *

* null sorting must be handled by the supplied * comparator. * * @param fieldName The sort field name * @param comparator The comparator used to sort this result. * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortAsc(String fieldName, java.util.Comparator comparator) throws IllegalArgumentException; /** * Reverse-sort this result by one of its contained fields using a * comparator. *

* null sorting must be handled by the supplied * comparator. * * @param fieldName The sort field name * @param comparator The comparator used to sort this result. * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortDesc(String fieldName, java.util.Comparator comparator) throws IllegalArgumentException; /** * Sort this result by one of its contained fields using a comparator. *

* null sorting must be handled by the supplied * comparator. * * @param fieldName The sort field name * @param comparator The comparator used to sort this result. * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortAsc(Name fieldName, java.util.Comparator comparator) throws IllegalArgumentException; /** * Reverse-sort this result by one of its contained fields using a * comparator. *

* null sorting must be handled by the supplied * comparator. * * @param fieldName The sort field name * @param comparator The comparator used to sort this result. * @return The result itself * @throws IllegalArgumentException If the argument field is not contained * in {@link #fieldsRow()} */ Result sortDesc(Name fieldName, java.util.Comparator comparator) throws IllegalArgumentException; /** * Sort this result using a comparator that can compare records. * * @param comparator The comparator used to sort this result. * @return The result itself */ Result sortAsc(java.util.Comparator comparator); /** * Reverse-sort this result using a comparator that can compare records. * * @param comparator The comparator used to sort this result. * @return The result itself */ Result sortDesc(java.util.Comparator comparator); /** * Specify a set of fields whose values should be interned. *

* See {@link Result#intern(int...)} for more details. * * @param fields The fields whose values should be interned * @return The same result * @see Result#intern(Field...) * @see String#intern() */ Result intern(Field... fields); /** * Specify a set of field indexes whose values should be interned. *

* This traverses all records and interns String values for a * given set of field indexes. Use this method to save memory when a large * result set contains many identical string literals. *

* Please refer to {@link String#intern()} and to publicly available * literature to learn more about potential side-effects of string * interning. *

* Future versions of jOOQ may also "intern" other data types, such as * {@link Integer}, {@link Long}, within a Result object. * * @param fieldIndexes The field indexes whose values should be interned * @return The same result * @see Result#intern(Field...) * @see String#intern() */ Result intern(int... fieldIndexes); /** * Specify a set of field names whose values should be interned. *

* See {@link Result#intern(int...)} for more details. * * @param fieldNames The field names whose values should be interned * @return The same result * @see Result#intern(Field...) * @see String#intern() */ Result intern(String... fieldNames); /** * Specify a set of field names whose values should be interned. *

* See {@link Result#intern(int...)} for more details. * * @param fieldNames The field names whose values should be interned * @return The same result * @see Result#intern(Field...) * @see String#intern() */ Result intern(Name... fieldNames); // ------------------------------------------------------------------------ // Fetching of new results based on records in this result // ------------------------------------------------------------------------ /** * Fetch parent records of this record, given a foreign key. * * @throws DataAccessException if something went wrong executing the query. * @see ForeignKey#fetchParent(Record) * @see ForeignKey#fetchParents(java.util.Collection) * @see ForeignKey#fetchParents(Record...) */ > Result fetchParents(ForeignKey key) throws DataAccessException; /** * Fetch child records of this record, given a foreign key. * * @throws DataAccessException if something went wrong executing the query. * @see ForeignKey#fetchChildren(java.util.Collection) * @see ForeignKey#fetchChildren(Record) * @see ForeignKey#fetchChildren(Record...) */ > Result fetchChildren(ForeignKey key) throws DataAccessException; // ------------------------------------------------------------------------ // Specialisations of Attachable methods // ------------------------------------------------------------------------ /** * Attach this result and all of its contained records to a new * {@link Configuration}. * * @param configuration A configuration or null, if you wish to * detach this Attachable from its previous * configuration. */ @Override void attach(Configuration configuration); /** * Detach this result and all of its contained records from their current * {@link Configuration}. *

* This is the same as calling attach(null). */ @Override void detach(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy