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

com.jporm.rx.connection.RxConnection Maven / Gradle / Ivy

The newest version!
/*******************************************************************************
 * Copyright 2015 Francesco Cina'
 *
 * 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.
 ******************************************************************************/
package com.jporm.rx.connection;

import java.util.Collection;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;

import com.jporm.commons.core.function.IntBiFunction;
import com.jporm.commons.core.transaction.TransactionIsolation;
import com.jporm.types.io.BatchPreparedStatementSetter;
import com.jporm.types.io.GeneratedKeyReader;
import com.jporm.types.io.ResultEntry;
import com.jporm.types.io.ResultSet;
import com.jporm.types.io.Statement;

import io.reactivex.Completable;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.Single;

public interface RxConnection {

    Single batchUpdate(Collection sqls, Function sqlPreProcessor);

    Single batchUpdate(String sql, BatchPreparedStatementSetter psc);

    Single batchUpdate(String sql, Collection> statementSetters);

    Completable execute(String sql);

     Observable query(String sql, final Consumer statementSetter, IntBiFunction resultSetReader);

     Observable query(String sql, Consumer pss, BiConsumer, ResultSet> rse);

    void setReadOnly(boolean readOnly);

    void setTimeout(int timeout);

    void setTransactionIsolation(TransactionIsolation isolation);

    Single update(String sql, final Consumer statementSetter);

     Single update(String sql, GeneratedKeyReader generatedKeyReader, final Consumer statementSetter);


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy