Last active
June 7, 2017 09:57
-
-
Save jklingsporn/70366adaf95f14c339aaadf4fcaef83f to your computer and use it in GitHub Desktop.
Rx dao example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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