ENTRY - the type of the entry dataDBO - the type of the database objectDAO - the type of the database access objectRESPONSE - the type of the response to the actionpublic abstract class AbstractDatabaseManager<ENTRY,DBO,DAO extends InsertDao<DBO>,RESPONSE>
extends java.lang.Object
implements net.ashwork.upvote.manager.AbstractInputManager<ENTRY,RESPONSE>
AbstractInputManager for a database.| Modifier and Type | Field and Description |
|---|---|
protected DAO |
dao |
protected java.util.function.IntFunction<RESPONSE> |
persistSuccess |
protected java.util.function.Function<java.lang.Throwable,RESPONSE> |
throwingError |
protected java.util.function.Function<ENTRY,DBO> |
transformer |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDatabaseManager(DAO dao,
java.util.function.Function<ENTRY,DBO> transformer,
java.util.function.IntFunction<RESPONSE> persistSuccess,
java.util.function.Function<java.lang.Throwable,RESPONSE> throwingError)
A simple constructor.
|
| Modifier and Type | Method and Description |
|---|---|
RESPONSE |
putEntry(ENTRY entry) |
protected final java.util.function.IntFunction<RESPONSE> persistSuccess
protected final java.util.function.Function<java.lang.Throwable,RESPONSE> throwingError
protected AbstractDatabaseManager(DAO dao, java.util.function.Function<ENTRY,DBO> transformer, java.util.function.IntFunction<RESPONSE> persistSuccess, java.util.function.Function<java.lang.Throwable,RESPONSE> throwingError)
dao - the domain access object of the tabletransformer - a function to transform the entry to a database objectpersistSuccess - a function to convert a successful insertion to a responsethrowingError - a function to convert a thrown throwable to a response