Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.jooq.impl.ResultQueryTrait Maven / Gradle / Ivy
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* Apache-2.0 license and offer limited warranties, support, maintenance, and
* commercial database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq.impl;
import static java.util.stream.Collectors.mapping;
import static java.util.stream.Collectors.toList;
import static org.jooq.Records.intoArray;
import static org.jooq.Records.intoGroups;
import static org.jooq.Records.intoList;
import static org.jooq.Records.intoMap;
import static org.jooq.Records.intoResultGroups;
import static org.jooq.Records.intoSet;
import static org.jooq.conf.SettingsTools.fetchIntermediateResult;
import static org.jooq.impl.DelayedArrayCollector.patch;
import static org.jooq.impl.Tools.blocking;
import static org.jooq.impl.Tools.indexOrFail;
import static org.jooq.tools.jdbc.JDBCUtils.safeClose;
import java.lang.reflect.Array;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.Spliterator;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;
import java.util.stream.Collector;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import org.jooq.CloseableResultQuery;
import org.jooq.Configuration;
import org.jooq.Converter;
import org.jooq.Cursor;
import org.jooq.Field;
import org.jooq.Name;
import org.jooq.QueryPartInternal;
import org.jooq.Record;
import org.jooq.Record1;
import org.jooq.Record10;
import org.jooq.Record11;
import org.jooq.Record12;
import org.jooq.Record13;
import org.jooq.Record14;
import org.jooq.Record15;
import org.jooq.Record16;
import org.jooq.Record17;
import org.jooq.Record18;
import org.jooq.Record19;
import org.jooq.Record2;
import org.jooq.Record20;
import org.jooq.Record21;
import org.jooq.Record22;
import org.jooq.Record3;
import org.jooq.Record4;
import org.jooq.Record5;
import org.jooq.Record6;
import org.jooq.Record7;
import org.jooq.Record8;
import org.jooq.Record9;
import org.jooq.RecordHandler;
import org.jooq.RecordMapper;
import org.jooq.Records;
import org.jooq.Result;
import org.jooq.ResultQuery;
import org.jooq.Results;
import org.jooq.Row;
import org.jooq.Select;
import org.jooq.Table;
import org.jooq.exception.DataAccessException;
import org.jooq.impl.R2DBC.BlockingRecordSubscription;
import org.jooq.impl.R2DBC.QuerySubscription;
import org.jooq.impl.R2DBC.ResultSubscriber;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.reactivestreams.Subscriber;
import io.r2dbc.spi.ConnectionFactory;
/**
* All the common fetch logic of a {@link ResultQuery}.
*
* @author Lukas Eder
*/
interface ResultQueryTrait
extends
QueryPartInternal,
CloseableResultQuery,
Mappable,
FieldsTrait
{
@Override
default CloseableResultQuery coerce(Field>... fields) {
return coerce(Arrays.asList(fields));
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1) {
return (CloseableResultQuery) coerce(new Field[] { field1 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1, Field field2) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1, Field field2, Field field3) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1, Field field2, Field field3, Field field4) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1, Field field2, Field field3, Field field4, Field field5) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(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) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(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) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(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) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(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) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(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) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(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) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(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) {
return (CloseableResultQuery) coerce(new Field[] { field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15, field16, field17, field18, field19 });
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
default CloseableResultQuery> coerce(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