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

com.julienviet.reactivex.pgclient.PgQuery Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you 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.julienviet.reactivex.pgclient;

import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.Completable;
import io.reactivex.Maybe;
import io.vertx.ext.sql.ResultSet;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;

/**
 * The binding of a {@link com.julienviet.reactivex.pgclient.PgPreparedStatement} and a set of parameters that can be executed once.
 *
 * 

* NOTE: This class has been automatically generated from the {@link com.julienviet.pgclient.PgQuery original} non RX-ified interface using Vert.x codegen. */ @io.vertx.lang.reactivex.RxGen(com.julienviet.pgclient.PgQuery.class) public class PgQuery { public static final io.vertx.lang.reactivex.TypeArg __TYPE_ARG = new io.vertx.lang.reactivex.TypeArg<>( obj -> new PgQuery((com.julienviet.pgclient.PgQuery) obj), PgQuery::getDelegate ); private final com.julienviet.pgclient.PgQuery delegate; public PgQuery(com.julienviet.pgclient.PgQuery delegate) { this.delegate = delegate; } public com.julienviet.pgclient.PgQuery getDelegate() { return delegate; } /** * Set the query result fetch size. *

* The default fetch size is 0 which means that all rows will be fetched at once. *

* @param size how many items should be fetched at once * @return a reference to this, so the API can be used fluently */ public PgQuery fetch(int size) { delegate.fetch(size); return this; } /** * @return true if the query is in progress and has more results to fetch */ public boolean inProgress() { boolean ret = delegate.inProgress(); return ret; } /** * @return true if the query execution is has been completed. */ public boolean completed() { boolean ret = delegate.completed(); return ret; } /** * Executes the query, the handler will be called when the result set is available or * if an error occurs. *

* Setting a fetch size positive value N asks Postgres to send at most N rows. * When the query is executed the method {@link com.julienviet.reactivex.pgclient.PgQuery#inProgress} ()} tells wether * there is remaining data to fetch or not. *

* Additional unfetched data shall be fetch using extra calls execute until the result set is complete. *

* @param handler the handler to call back */ public void execute(Handler> handler) { delegate.execute(handler); } /** * Executes the query, the handler will be called when the result set is available or * if an error occurs. *

* Setting a fetch size positive value N asks Postgres to send at most N rows. * When the query is executed the method {@link com.julienviet.reactivex.pgclient.PgQuery#inProgress} ()} tells wether * there is remaining data to fetch or not. *

* Additional unfetched data shall be fetch using extra calls execute until the result set is complete. *

* @return */ public Single rxExecute() { return new io.vertx.reactivex.core.impl.AsyncResultSingle(handler -> { execute(handler); }); } /** * When the query is managing a cursor, the corresponding resources is released. You don't need * to close the query when the query was executed fully. */ public void close() { delegate.close(); } /** * Like {@link com.julienviet.reactivex.pgclient.PgQuery#close} but with a completion handler to be notified of the result. * @param completionHandler */ public void close(Handler> completionHandler) { delegate.close(completionHandler); } /** * Like {@link com.julienviet.reactivex.pgclient.PgQuery#close} but with a completion handler to be notified of the result. * @return */ public Completable rxClose() { return new io.vertx.reactivex.core.impl.AsyncResultCompletable(handler -> { close(handler); }); } public static PgQuery newInstance(com.julienviet.pgclient.PgQuery arg) { return arg != null ? new PgQuery(arg) : null; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy