vertx-jooq goes rx

After releasing a new version of your pet-project – what do you expect as a first reaction? Cheer? Love? Joy? No. People will ask for more. Welcome to the internet:

Clement Escoffier, vertx hero and avenger of unresolved github-issues however jumped in and added RX-Java support for vertx-jooq! Thanks to him, there is a new VertxDao that exposes various RX-like CRUD-methods:


public interface VertxDao<R extends UpdatableRecord<R>, P, T> extends DAO<R, P, T> {
/**
* Convenience method to execute any <code>DSLContext</code>-aware Function asynchronously
* using this DAO's <code>configuration</code>.
*
* @param function
* @param <X>
* @return Single
*/
<X> Single<X> executeAsync(Function<DSLContext, X> function);
/**
* Performs an async <code>INSERT</code> statement for a given POJO
*
* @param object The POJO to be inserted
* @return Completable which succeeds when the blocking method of this type succeeds or fails
* with an <code>DataAccessException</code> if the blocking method of this type throws an exception
* @see #insert(Object)
*/
Completable insertAsync(P object);
/**
* Performs an async <code>UPDATE</code> statement for a given POJO
*
* @param object The POJO to be updated
* @return Completable which succeeds when the blocking method of this type succeeds or fails
* with an <code>DataAccessException</code> if the blocking method of this type throws an exception
* @see #update(Object)
*/
Completable updateAsync(P object);
/**
* Performs an async <code>DELETE</code> statement for a given ID
*
* @param id The ID to be deleted
* @return Completable which succeeds when the blocking method of this type succeeds or fails
* with an <code>DataAccessException</code> if the blocking method of this type throws an exception
* @see #delete(Object…)
*/
Completable deleteByIdAsync(T id);
}

view raw

VertxDAO.java

hosted with ❤ by GitHub

This is cool! Also don’t forget to check the github-page for more details.

Leave a comment