R
- The record type contained in this resultpublic interface Result<R extends Record> extends List<R>, Attachable
SelectQuery
ResultQuery.getResult()
Modifier and Type | Method and Description |
---|---|
<T> Field<T> |
field(Field<T> field)
Get a specific field from this Result.
|
Field<?> |
field(int index)
Get a specific field from this Result.
|
Field<?> |
field(String name)
Get a specific field from this Result.
|
Field<?>[] |
fields()
Get all fields from this Result.
|
Row |
fieldsRow()
Get this result's fields as a
Row . |
String |
format()
Get a simple formatted representation of this result.
|
String |
format(int maxRecords)
Get a simple formatted representation of this result.
|
String |
formatCSV()
Get a simple formatted representation of this result as CSV.
|
String |
formatCSV(char delimiter)
Get a simple formatted representation of this result as CSV.
|
String |
formatCSV(char delimiter,
String nullString)
Get a simple formatted representation of this result as CSV.
|
String |
formatHTML()
Get a simple formatted representation of this result as HTML.
|
String |
formatJSON()
Get a simple formatted representation of this result as a JSON array of
array.
|
String |
formatXML()
Get this result formatted as XML.
|
<T> T |
getValue(int index,
Field<T> field)
Convenience method to fetch a value at a given position in the result.
|
<T> T |
getValue(int index,
Field<T> field,
T defaultValue)
Deprecated.
- 3.3.0 - [#2878] - This method will be removed in jOOQ 4.0
|
Object |
getValue(int index,
int fieldIndex)
Convenience method to fetch a value at a given position in the result.
|
Object |
getValue(int index,
int fieldIndex,
Object defaultValue)
Deprecated.
- 3.3.0 - [#2878] - This method will be removed in jOOQ 4.0
|
Object |
getValue(int index,
String fieldName)
Convenience method to fetch a value at a given position in the result.
|
Object |
getValue(int index,
String fieldName,
Object defaultValue)
Deprecated.
- 3.3.0 - [#2878] - This method will be removed in jOOQ 4.0
|
<T> List<T> |
getValues(Field<?> field,
Class<? extends T> type)
Convenience method to fetch all values for a given field.
|
<T> List<T> |
getValues(Field<T> field)
Convenience method to fetch all values for a given field.
|
<T,U> List<U> |
getValues(Field<T> field,
Converter<? super T,U> converter)
Convenience method to fetch all values for a given field.
|
List<?> |
getValues(int fieldIndex)
Convenience method to fetch all values for a given field.
|
<T> List<T> |
getValues(int fieldIndex,
Class<? extends T> type)
Convenience method to fetch all values for a given field.
|
<U> List<U> |
getValues(int fieldIndex,
Converter<?,U> converter)
Convenience method to fetch all values for a given field.
|
List<?> |
getValues(String fieldName)
Convenience method to fetch all values for a given field.
|
<T> List<T> |
getValues(String fieldName,
Class<? extends T> type)
Convenience method to fetch all values for a given field.
|
<U> List<U> |
getValues(String fieldName,
Converter<?,U> converter)
Convenience method to fetch all values for a given field.
|
Result<R> |
intern(Field<?>... fields)
Specify a set of fields whose values should be interned.
|
Result<R> |
intern(int... fieldIndexes)
Specify a set of field indexes whose values should be interned.
|
Result<R> |
intern(String... fieldNames)
Specify a set of field names whose values should be interned.
|
<E> List<E> |
into(Class<? extends E> type)
Map resulting records onto a custom type.
|
<H extends RecordHandler<? super R>> |
into(H handler)
Map results into a custom handler callback.
|
<Z extends Record> |
into(Table<Z> table)
Map resulting records onto a custom record.
|
Object[][] |
intoArray()
Convert this result into an array of arrays.
|
<T> T[] |
intoArray(Field<?> field,
Class<? extends T> type)
Return all values for a field from the result.
|
<T> T[] |
intoArray(Field<T> field)
Return all values for a field from the result.
|
<T,U> U[] |
intoArray(Field<T> field,
Converter<? super T,U> converter)
Return all values for a field from the result.
|
Object[] |
intoArray(int fieldIndex)
Return all values for a field index from the result.
|
<T> T[] |
intoArray(int fieldIndex,
Class<? extends T> type)
Return all values for a field index from the result.
|
<U> U[] |
intoArray(int fieldIndex,
Converter<?,U> converter)
Return all values for a field index from the result.
|
Object[] |
intoArray(String fieldName)
Return all values for a field name from the result.
|
<T> T[] |
intoArray(String fieldName,
Class<? extends T> type)
Return all values for a field name from the result.
|
<U> U[] |
intoArray(String fieldName,
Converter<?,U> converter)
Return all values for a field name from the result.
|
Map<Record,Result<R>> |
intoGroups(Field<?>[] keys)
Return a
Map with the result grouped by the given keys. |
<E> Map<Record,List<E>> |
intoGroups(Field<?>[] keys,
Class<? extends E> type)
Return a
Map with results grouped by the given keys and mapped
into the given entity type. |
<E> Map<Record,List<E>> |
intoGroups(Field<?>[] keys,
RecordMapper<? super R,E> mapper)
Return a
Map with results grouped by the given keys and mapped
into the given entity type. |
<K> Map<K,Result<R>> |
intoGroups(Field<K> key)
Return a
Map with one of the result's columns as key and a list
of corresponding records as value. |
<K,E> Map<K,List<E>> |
intoGroups(Field<K> key,
Class<? extends E> type)
Return a
Map with results grouped by the given key and mapped
into the given entity type. |
<K,V> Map<K,List<V>> |
intoGroups(Field<K> key,
Field<V> value)
Return a
Map with one of the result's columns as key and another
one of the result's columns as value. |
<K,E> Map<K,List<E>> |
intoGroups(Field<K> key,
RecordMapper<? super R,E> mapper)
Return a
Map with results grouped by the given key and mapped by
the given mapper. |
Map<Record,R> |
intoMap(Field<?>[] keys)
Return a
Map with the given keys as a map key and the
corresponding record as value. |
<E> Map<List<?>,E> |
intoMap(Field<?>[] keys,
Class<? extends E> type)
Return a
Map with results grouped by the given keys and mapped
into the given entity type. |
<E> Map<List<?>,E> |
intoMap(Field<?>[] keys,
RecordMapper<? super R,E> mapper)
Return a
Map with results grouped by the given keys and mapped by
the given mapper |
<K> Map<K,R> |
intoMap(Field<K> key)
Return a
Map with one of the result's columns as key and the
corresponding records as value. |
<K,E> Map<K,E> |
intoMap(Field<K> key,
Class<? extends E> type)
Return a
Map with results grouped by the given key and mapped
into the given entity type. |
<K,V> Map<K,V> |
intoMap(Field<K> key,
Field<V> value)
Return a
Map with one of the result's columns as key and another
one of the result's columns as value
An InvalidResultException is thrown, if the key turns out to be
non-unique in the result set. |
<K,E> Map<K,E> |
intoMap(Field<K> key,
RecordMapper<? super R,E> mapper)
Return a
Map with results grouped by the given key and mapped by
the given mapper. |
List<Map<String,Object>> |
intoMaps()
Return the generated result as a list of name/value maps.
|
ResultSet |
intoResultSet()
Generate an in-memory JDBC
ResultSet containing the data of this
Result . |
Document |
intoXML()
Get this result as XML.
|
<H extends ContentHandler> |
intoXML(H handler)
Get this result as XML using a SAX
ContentHandler . |
boolean |
isEmpty()
Whether there are any records contained in this
Result . |
boolean |
isNotEmpty()
Whether there are any records contained in this
Result . |
<E> List<E> |
map(RecordMapper<? super R,E> mapper)
Map results into a custom mapper callback.
|
RecordType<R> |
recordType()
Get this result's record type.
|
Result<R> |
sortAsc(Comparator<? super R> comparator)
Sort this result using a comparator that can compare records.
|
<T extends Comparable<? super T>> |
sortAsc(Field<T> field)
Sort this result by one of its contained fields.
|
<T> Result<R> |
sortAsc(Field<T> field,
Comparator<? super T> comparator)
Sort this result by one of its contained fields using a comparator.
|
Result<R> |
sortAsc(int fieldIndex)
Sort this result by one of its contained fields.
|
Result<R> |
sortAsc(int fieldIndex,
Comparator<?> comparator)
Sort this result by one of its contained fields using a comparator.
|
Result<R> |
sortAsc(String fieldName)
Sort this result by one of its contained fields.
|
Result<R> |
sortAsc(String fieldName,
Comparator<?> comparator)
Sort this result by one of its contained fields using a comparator.
|
Result<R> |
sortDesc(Comparator<? super R> comparator)
Reverse-sort this result using a comparator that can compare records.
|
<T extends Comparable<? super T>> |
sortDesc(Field<T> field)
Reverse-sort this result by one of its contained fields.
|
<T> Result<R> |
sortDesc(Field<T> field,
Comparator<? super T> comparator)
Reverse-sort this result by one of its contained fields using a
comparator.
|
Result<R> |
sortDesc(int fieldIndex)
Reverse-sort this result by one of its contained fields.
|
Result<R> |
sortDesc(int fieldIndex,
Comparator<?> comparator)
Reverse-sort this result by one of its contained fields using a
comparator.
|
Result<R> |
sortDesc(String fieldName)
Reverse-sort this result by one of its contained fields.
|
Result<R> |
sortDesc(String fieldName,
Comparator<?> comparator)
Reverse-sort this result by one of its contained fields using a
comparator.
|
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
attach, detach
RecordType<R> recordType()
<T> Field<T> field(Field<T> field)
Row.field(Field)
Field<?> field(String name)
Row.field(String)
Field<?> field(int index)
Row.field(int)
Field<?>[] fields()
Row.fields()
<T> T getValue(int index, Field<T> field) throws IndexOutOfBoundsException, IllegalArgumentException
T
- The value's field's generic type parameterindex
- The record's indexfield
- The value's fieldIndexOutOfBoundsException
- if the index is out of range (
index < 0 || index >= size())IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
@Deprecated <T> T getValue(int index, Field<T> field, T defaultValue) throws IndexOutOfBoundsException, IllegalArgumentException
T
- The value's field's generic type parameterindex
- The record's indexfield
- The value's fielddefaultValue
- The default value if the value was null
IndexOutOfBoundsException
- if the index is out of range (
index < 0 || index >= size())IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Object getValue(int index, int fieldIndex) throws IndexOutOfBoundsException, IllegalArgumentException
index
- The record's indexfieldIndex
- The value's field indexIndexOutOfBoundsException
- if the index is out of range (
index < 0 || index >= size())IllegalArgumentException
- If the argument fieldIndex is not
contained in fieldsRow()
@Deprecated Object getValue(int index, int fieldIndex, Object defaultValue) throws IndexOutOfBoundsException, IllegalArgumentException
index
- The record's indexfieldIndex
- The value's field indexdefaultValue
- The default value if the value was null
IndexOutOfBoundsException
- if the index is out of range (
index < 0 || index >= size())IllegalArgumentException
- If the argument fieldIndex is not
contained in fieldsRow()
Object getValue(int index, String fieldName) throws IndexOutOfBoundsException, IllegalArgumentException
index
- The record's indexfieldName
- The value's field nameIndexOutOfBoundsException
- if the index is out of range (
index < 0 || index >= size())IllegalArgumentException
- If the argument fieldName is not
contained in fieldsRow()
@Deprecated Object getValue(int index, String fieldName, Object defaultValue) throws IndexOutOfBoundsException, IllegalArgumentException
index
- The record's indexfieldName
- The value's field namedefaultValue
- The default value if the value was null
IndexOutOfBoundsException
- if the index is out of range (
index < 0 || index >= size())IllegalArgumentException
- If the argument fieldName is not
contained in fieldsRow()
<T> List<T> getValues(Field<T> field) throws IllegalArgumentException
T
- The values' field's generic type parameterfield
- The values' fieldIllegalArgumentException
- If the argument field is not contained
in fieldsRow()
<T> List<T> getValues(Field<?> field, Class<? extends T> type) throws IllegalArgumentException
field
- The values' fieldtype
- The type used for type conversionIllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Record.getValue(Field, Class)
,
Convert.convert(Object, Class)
<T,U> List<U> getValues(Field<T> field, Converter<? super T,U> converter) throws IllegalArgumentException
field
- The values' fieldconverter
- The data type converter used for type conversionIllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Record.getValue(Field, Converter)
,
Convert.convert(Object, Converter)
List<?> getValues(int fieldIndex) throws IllegalArgumentException
fieldIndex
- The values' field indexIllegalArgumentException
- If the argument fieldIndex is not
contained in fieldsRow()
<T> List<T> getValues(int fieldIndex, Class<? extends T> type) throws IllegalArgumentException, DataTypeException
fieldIndex
- The values' field indextype
- The type used for type conversionIllegalArgumentException
- If the argument fieldIndex is not
contained in fieldsRow()
DataTypeException
- wrapping any data type conversion exception
that might have occurredRecord.getValue(int, Class)
,
Convert.convert(Object, Class)
<U> List<U> getValues(int fieldIndex, Converter<?,U> converter) throws IllegalArgumentException, DataTypeException
fieldIndex
- The values' field indexconverter
- The data type converter used for type conversionIllegalArgumentException
- If the argument fieldIndex is not
contained in fieldsRow()
DataTypeException
- wrapping any data type conversion exception
that might have occurredRecord.getValue(int, Converter)
,
Convert.convert(Object, Converter)
List<?> getValues(String fieldName) throws IllegalArgumentException
fieldName
- The values' field nameIllegalArgumentException
- If the argument fieldName is not
contained in fieldsRow()
<T> List<T> getValues(String fieldName, Class<? extends T> type) throws IllegalArgumentException, DataTypeException
fieldName
- The values' field nametype
- The type used for type conversionIllegalArgumentException
- If the argument fieldName is not
contained in fieldsRow()
DataTypeException
- wrapping any data type conversion exception
that might have occurredRecord.getValue(String, Class)
,
Convert.convert(Object, Class)
<U> List<U> getValues(String fieldName, Converter<?,U> converter) throws IllegalArgumentException, DataTypeException
fieldName
- The values' field nameconverter
- The data type converter used for type conversionIllegalArgumentException
- If the argument fieldName is not
contained in fieldsRow()
DataTypeException
- wrapping any data type conversion exception
that might have occurredRecord.getValue(String, Converter)
,
Convert.convert(Object, Converter)
boolean isEmpty()
Result
.boolean isNotEmpty()
Result
.String format()
This is the same as calling format(int)
with
maxRows = 50
String format(int maxRecords)
maxRecords
- The maximum number of records to include in the
formatted resultString formatHTML()
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>
String formatCSV()
This is the same as calling formatCSV(',', "")
String formatCSV(char delimiter)
This is the same as calling formatCSV(delimiter, "")
delimiter
- The delimiter to use between recordsString formatCSV(char delimiter, String nullString)
delimiter
- The delimiter to use between recordsnullString
- A special string for encoding NULL
values.String formatJSON()
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]]}
String formatXML()
Document intoXML()
<H extends ContentHandler> H intoXML(H handler) throws SAXException
ContentHandler
.handler
- The custom content handler.SAXException
formatXML()
,
http://www.jooq.org/xsd/jooq-export-2.6.0.xsdList<Map<String,Object>> intoMaps()
Record.intoMap()
<K> Map<K,R> intoMap(Field<K> key) throws IllegalArgumentException, InvalidResultException
Map
with one of the result's columns as key and the
corresponding records as value.
An InvalidResultException
is thrown, if the key turns out to be
non-unique in the result set. Use intoGroups(Field)
instead, if
your keys are non-unique
K
- The key's generic field typekey
- The key field. Client code must assure that this field is
unique in the result set.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
InvalidResultException
- if the key field returned two or more
equal values from the result set.<K,V> Map<K,V> intoMap(Field<K> key, Field<V> value) throws IllegalArgumentException, InvalidResultException
Map
with one of the result's columns as key and another
one of the result's columns as value
An InvalidResultException
is thrown, if the key turns out to be
non-unique in the result set. Use intoGroups(Field, Field)
instead, if your keys are non-unique
K
- The key's generic field typeV
- The value's generic field typekey
- The key field. Client code must assure that this field is
unique in the result set.value
- The value fieldIllegalArgumentException
- If any of the argument fields is not
contained in fieldsRow()
InvalidResultException
- if the key field returned two or more
equal values from the result set.Map<Record,R> intoMap(Field<?>[] keys) throws IllegalArgumentException, InvalidResultException
Map
with the given keys as a map key and the
corresponding record as value.
An InvalidResultException
is thrown, if the keys are non-unique
in the result set. Use intoGroups(Field[])
instead, if your keys
are non-unique.
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.IllegalArgumentException
- If any of the argument fields is not
contained in fieldsRow()
InvalidResultException
- if the keys are non-unique in the result
set.<K,E> Map<K,E> intoMap(Field<K> key, Class<? extends E> type) throws IllegalArgumentException, InvalidResultException, MappingException
Map
with results grouped by the given key and mapped
into the given entity type.
An InvalidResultException
is thrown, if the key is non-unique in
the result set. Use intoGroups(Field, Class)
instead, if your
key is non-unique.
key
- The key. Client code must assure that key is unique in the
result set.type
- The entity type.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
InvalidResultException
- if the key is non-unique in the result
set.MappingException
- wrapping any reflection or data type conversion
exception that might have occurred while mapping recordsDefaultRecordMapper
<K,E> Map<K,E> intoMap(Field<K> key, RecordMapper<? super R,E> mapper) throws IllegalArgumentException, InvalidResultException, MappingException
Map
with results grouped by the given key and mapped by
the given mapper.
An InvalidResultException
is thrown, if the key is non-unique in
the result set. Use intoGroups(Field, Class)
instead, if your
key is non-unique.
key
- The key. Client code must assure that key is unique in the
result set.mapper
- The mapper callback.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
InvalidResultException
- if the key is non-unique in the result
set.MappingException
- wrapping any reflection or data type conversion
exception that might have occurred while mapping recordsDefaultRecordMapper
<E> Map<List<?>,E> intoMap(Field<?>[] keys, Class<? extends E> type) throws IllegalArgumentException, InvalidResultException, MappingException
Map
with results grouped by the given keys and mapped
into the given entity type.
An InvalidResultException
is thrown, if the keys are non-unique
in the result set. Use intoGroups(Field[], Class)
instead, if
your keys are non-unique.
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.type
- The entity type.IllegalArgumentException
- If any of the argument fields is not
contained in fieldsRow()
InvalidResultException
- if the keys are non-unique in the result
set.MappingException
- wrapping any reflection or data type conversion
exception that might have occurred while mapping recordsDefaultRecordMapper
<E> Map<List<?>,E> intoMap(Field<?>[] keys, RecordMapper<? super R,E> mapper) throws IllegalArgumentException, InvalidResultException, MappingException
Map
with results grouped by the given keys and mapped by
the given mapper. *
An InvalidResultException
is thrown, if the keys are non-unique
in the result set. Use intoGroups(Field[], Class)
instead, if
your keys are non-unique.
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.mapper
- The mapper callback.IllegalArgumentException
- If any of the argument fields is not
contained in fieldsRow()
InvalidResultException
- if the keys are non-unique in the result
set.MappingException
- wrapping any reflection or data type conversion
exception that might have occurred while mapping recordsDefaultRecordMapper
<K> Map<K,Result<R>> intoGroups(Field<K> key) throws IllegalArgumentException
Map
with one of the result's columns as key and a list
of corresponding records as value.
Unlike intoMap(Field)
, this method allows for non-unique keys in
the result set.
K
- The key's generic field typekey
- The key field.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
<K,V> Map<K,List<V>> intoGroups(Field<K> key, Field<V> value) throws IllegalArgumentException
Map
with one of the result's columns as key and another
one of the result's columns as value.
Unlike intoMap(Field, Field)
, this method allows for non-unique
keys in the result set.
K
- The key's generic field typeV
- The value's generic field typekey
- The key field.value
- The value fieldIllegalArgumentException
- If any of the argument fields is not
contained in fieldsRow()
Map<Record,Result<R>> intoGroups(Field<?>[] keys) throws IllegalArgumentException
Map
with the result grouped by the given keys.
Unlike intoMap(Field[])
, this method allows for non-unique keys
in the result set.
keys
- The keys. If this is null
or an empty array, the
resulting map will contain at most one entry.IllegalArgumentException
- If any of the argument fields is not
contained in fieldsRow()
<K,E> Map<K,List<E>> intoGroups(Field<K> key, Class<? extends E> type) throws IllegalArgumentException, MappingException
Map
with results grouped by the given key and mapped
into the given entity type.
K
- The key's generic field typeE
- The generic entity type.key
- The key field.type
- The entity type.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
MappingException
- wrapping any reflection or data type conversion
exception that might have occurred while mapping recordsDefaultRecordMapper
<K,E> Map<K,List<E>> intoGroups(Field<K> key, RecordMapper<? super R,E> mapper) throws IllegalArgumentException, MappingException
Map
with results grouped by the given key and mapped by
the given mapper.K
- The key's generic field typeE
- The generic entity type.key
- The key field.mapper
- The mapper callback.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
MappingException
- wrapping any reflection or data type conversion
exception that might have occurred while mapping records<E> Map<Record,List<E>> intoGroups(Field<?>[] keys, Class<? extends E> type) throws IllegalArgumentException, MappingException
Map
with results grouped by the given keys and mapped
into the given entity type.
Unlike intoMap(Field[], Class)
, this method allows for
non-unique keys in the result set.
keys
- The keys. If this is null
or an empty array, the
resulting map will contain at most one entry.type
- The entity type.IllegalArgumentException
- If the any of the argument fields is not
contained in fieldsRow()
MappingException
- wrapping any reflection or data type conversion
exception that might have occurred while mapping recordsDefaultRecordMapper
<E> Map<Record,List<E>> intoGroups(Field<?>[] keys, RecordMapper<? super R,E> mapper) throws IllegalArgumentException, MappingException
Map
with results grouped by the given keys and mapped
into the given entity type.
Unlike intoMap(Field[], Class)
, this method allows for
non-unique keys in the result set.
keys
- The keys. If this is null
or an empty array, the
resulting map will contain at most one entry.mapper
- The mapper callback.IllegalArgumentException
- If the any of the argument fields is not
contained in fieldsRow()
MappingException
- wrapping any reflection or data type conversion
exception that might have occurred while mapping recordsDefaultRecordMapper
Object[][] intoArray()
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]
This is the same as calling into(Object[].class)
Record.intoArray()
Object[] intoArray(int fieldIndex) throws IllegalArgumentException
You can access data like this
result.intoArray(fieldIndex)[recordIndex]
Object[]
, depending on whether jOOQ has any
knowledge about fieldIndex
's actual type.IllegalArgumentException
- If the argument fieldIndex is not
contained in fieldsRow()
getValues(int)
<T> T[] intoArray(int fieldIndex, Class<? extends T> type) throws IllegalArgumentException, DataTypeException
You can access data like this
result.intoArray(fieldIndex)[recordIndex]
IllegalArgumentException
- If the argument fieldIndex is not
contained in fieldsRow()
DataTypeException
- wrapping any data type conversion exception
that might have occurredgetValues(int, Class)
<U> U[] intoArray(int fieldIndex, Converter<?,U> converter) throws IllegalArgumentException, DataTypeException
You can access data like this
result.intoArray(fieldIndex)[recordIndex]
IllegalArgumentException
- If the argument fieldIndex is not
contained in fieldsRow()
DataTypeException
- wrapping any data type conversion exception
that might have occurredgetValues(int, Converter)
Object[] intoArray(String fieldName) throws IllegalArgumentException
You can access data like this
result.intoArray(fieldName)[recordIndex]
Object[]
, depending on whether jOOQ has any
knowledge about fieldName
's actual type.IllegalArgumentException
- If the argument fieldName is not
contained in fieldsRow()
getValues(String)
<T> T[] intoArray(String fieldName, Class<? extends T> type) throws IllegalArgumentException, DataTypeException
You can access data like this
result.intoArray(fieldName)[recordIndex]
IllegalArgumentException
- If the argument fieldName is not
contained in fieldsRow()
DataTypeException
- wrapping any data type conversion exception
that might have occurredgetValues(String, Class)
<U> U[] intoArray(String fieldName, Converter<?,U> converter) throws IllegalArgumentException, DataTypeException
You can access data like this
result.intoArray(fieldName)[recordIndex]
IllegalArgumentException
- If the argument fieldName is not
contained in fieldsRow()
DataTypeException
- wrapping any data type conversion exception
that might have occurredgetValues(String, Converter)
<T> T[] intoArray(Field<T> field) throws IllegalArgumentException
You can access data like this
result.intoArray(field)[recordIndex]
IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
getValues(Field)
<T> T[] intoArray(Field<?> field, Class<? extends T> type) throws IllegalArgumentException, DataTypeException
You can access data like this
result.intoArray(field)[recordIndex]
IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
DataTypeException
- wrapping any data type conversion exception
that might have occurredgetValues(Field, Class)
<T,U> U[] intoArray(Field<T> field, Converter<? super T,U> converter) throws IllegalArgumentException, DataTypeException
You can access data like this
result.intoArray(field)[recordIndex]
IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
DataTypeException
- wrapping any data type conversion exception
that might have occurredgetValues(Field, Converter)
<E> List<E> into(Class<? extends E> type) throws MappingException
This is the same as calling record.into(type)
on every
record contained in this Result
. See
Record.into(Class)
for more details
E
- The generic entity type.type
- The entity type.MappingException
- wrapping any reflection or data type conversion
exception that might have occurred while mapping recordsRecord.into(Class)
,
DefaultRecordMapper
<Z extends Record> Result<Z> into(Table<Z> table) throws MappingException
This is the same as calling record.into(table)
on every
record contained in this Result
. See
Record.into(Table)
for more details
Z
- The generic table record type.table
- The table type.MappingException
- wrapping any reflection or data type conversion
exception that might have occurred while mapping recordsRecord.into(Table)
<H extends RecordHandler<? super R>> H into(H handler)
handler
- The handler callbackResultSet intoResultSet()
ResultSet
containing the data of this
Result
.
Use this as an adapter for JDBC-compliant code that expects a
ResultSet
to operate on, rather than a jOOQ Result
. The
returned ResultSet
allows for the following behaviour
according to the JDBC specification:
ResultSet.CLOSE_CURSORS_AT_COMMIT
: The cursors (i.e.
Statement
object) are no longer availableResultSet.CONCUR_READ_ONLY
: You cannot update the database
through this ResultSet
, as the underlying Result
object does not hold any open database refences anymoreResultSet.FETCH_FORWARD
: The fetch direction is forward only,
and cannot be changedResultSet.TYPE_SCROLL_INSENSITIVE
: You can use any of the
ResultSet
's scrolling methods, e.g. ResultSet.next()
or ResultSet.previous()
, etc.
You may use DSLContext.fetch(ResultSet)
to unwind this wrapper
again.
ResultSet
<E> List<E> map(RecordMapper<? super R,E> mapper)
mapper
- The mapper callback<T extends Comparable<? super T>> Result<R> sortAsc(Field<T> field) throws IllegalArgumentException
nulls
are sorted last by this method.
field
- The sort fieldIllegalArgumentException
- If the argument field is not contained
in fieldsRow()
<T extends Comparable<? super T>> Result<R> sortDesc(Field<T> field) throws IllegalArgumentException
nulls
are sorted last by this method.
field
- The sort fieldIllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Result<R> sortAsc(int fieldIndex) throws IllegalArgumentException
nulls
are sorted last by this method.
fieldIndex
- The sort field indexIllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Result<R> sortDesc(int fieldIndex) throws IllegalArgumentException
nulls
are sorted last by this method.
fieldIndex
- The sort field indexIllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Result<R> sortAsc(String fieldName) throws IllegalArgumentException
nulls
are sorted last by this method.
fieldName
- The sort field nameIllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Result<R> sortDesc(String fieldName) throws IllegalArgumentException
nulls
are sorted last by this method.
fieldName
- The sort field nameIllegalArgumentException
- If the argument field is not contained
in fieldsRow()
<T> Result<R> sortAsc(Field<T> field, Comparator<? super T> comparator) throws IllegalArgumentException
null
sorting must be handled by the supplied
comparator
.
field
- The sort fieldcomparator
- The comparator used to sort this result.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
<T> Result<R> sortDesc(Field<T> field, Comparator<? super T> comparator) throws IllegalArgumentException
null
sorting must be handled by the supplied
comparator
.
field
- The sort fieldcomparator
- The comparator used to sort this result.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Result<R> sortAsc(int fieldIndex, Comparator<?> comparator) throws IllegalArgumentException
null
sorting must be handled by the supplied
comparator
.
fieldIndex
- The sort field indexcomparator
- The comparator used to sort this result.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Result<R> sortDesc(int fieldIndex, Comparator<?> comparator) throws IllegalArgumentException
null
sorting must be handled by the supplied
comparator
.
fieldIndex
- The sort field indexcomparator
- The comparator used to sort this result.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Result<R> sortAsc(String fieldName, Comparator<?> comparator) throws IllegalArgumentException
null
sorting must be handled by the supplied
comparator
.
fieldName
- The sort field namecomparator
- The comparator used to sort this result.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Result<R> sortDesc(String fieldName, Comparator<?> comparator) throws IllegalArgumentException
null
sorting must be handled by the supplied
comparator
.
fieldName
- The sort field namecomparator
- The comparator used to sort this result.IllegalArgumentException
- If the argument field is not contained
in fieldsRow()
Result<R> sortAsc(Comparator<? super R> comparator)
comparator
- The comparator used to sort this result.Result<R> sortDesc(Comparator<? super R> comparator)
comparator
- The comparator used to sort this result.Result<R> intern(Field<?>... fields)
See intern(int...)
for more details.
fields
- The fields whose values should be internedintern(Field...)
,
String.intern()
Result<R> intern(int... fieldIndexes)
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 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
Integer
, Long
, within a Result
object.
fieldIndexes
- The field indexes whose values should be internedintern(Field...)
,
String.intern()
Result<R> intern(String... fieldNames)
See intern(int...)
for more details.
fieldNames
- The field names whose values should be internedintern(Field...)
,
String.intern()
Copyright © 2014. All Rights Reserved.