public final class DatabaseHelper
extends java.lang.Object
| Constructor and Description |
|---|
DatabaseHelper() |
| Modifier and Type | Method and Description |
|---|---|
static <DBO,DAO extends InsertDao<DBO>,RESPONSE> |
persistToDatabase(DAO dao,
DBO dbo,
java.util.function.IntFunction<RESPONSE> success,
java.util.function.Function<java.lang.Throwable,RESPONSE> error)
Inserts an entry into a table and returns some response pertaining to
whether the insertion was successful or not.
|
static <DBO,DAO extends InsertDao<DBO>,RESPONSE> |
persistToDatabase(DAO dao,
java.util.List<DBO> dbos,
java.util.function.Supplier<RESPONSE> success,
java.util.function.Function<java.lang.Throwable,RESPONSE> error)
Inserts multiple entries into a table and returns some response pertaining
to whether the insertions were successful or not.
|
public static <DBO,DAO extends InsertDao<DBO>,RESPONSE> RESPONSE persistToDatabase(DAO dao, DBO dbo, java.util.function.IntFunction<RESPONSE> success, java.util.function.Function<java.lang.Throwable,RESPONSE> error)
DBO - the type of the database objectDAO - the type of the domain access objectRESPONSE - the type of the response of the insertiondao - the domain access object of the tabledbo - the database object being insertedsuccess - a function to convert a successful insertion to a responseerror - a function to convert a thrown throwable to a responseInsertDaopublic static <DBO,DAO extends InsertDao<DBO>,RESPONSE> RESPONSE persistToDatabase(DAO dao, java.util.List<DBO> dbos, java.util.function.Supplier<RESPONSE> success, java.util.function.Function<java.lang.Throwable,RESPONSE> error)
DBO - the type of the database objectDAO - the type of the domain access objectRESPONSE - the type of the response of the insertionsdao - the domain access object of the tabledbos - the database objects being insertedsuccess - a supplied response for successful insertionserror - a function to convert a thrown throwable to a responseInsertDao