Skip to content

Instantly share code, notes, and snippets.

@jklingsporn
Last active Jun 7, 2017
Embed
What would you like to do?
Rx dao example
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);
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment