public abstract class BaseDao extends Object
| Modifier and Type | Field and Description |
|---|---|
static Object |
DUMMY_RETURN_OBJECT |
| Constructor and Description |
|---|
BaseDao(DataSource dataSource) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
close(Connection connection) |
protected void |
close(Connection connection,
Statement statement) |
void |
close(Connection connection,
Statement statement,
ResultSet resultSet) |
protected void |
close(ResultSet resultSet) |
protected void |
close(Statement statement) |
protected Connection |
getConnection() |
protected String |
getSQLFormattedIdList(int listLength) |
protected void |
rollback(Connection connection,
String message) |
<R,E extends Exception> |
selectAndGetOperation(ThrowingFunction<Connection,R,E> command) |
<E extends Exception> |
selectOperation(ThrowingConsumer<Connection,E> command) |
<E extends Exception> |
transaction(ThrowingConsumer<Connection,E> command) |
<R,E extends Exception> |
transaction(ThrowingFunction<Connection,R,E> command) |
public static final Object DUMMY_RETURN_OBJECT
public BaseDao(DataSource dataSource)
protected Connection getConnection() throws SQLException
SQLExceptionprotected void close(Connection connection)
protected void close(Connection connection, Statement statement)
public void close(Connection connection, Statement statement, ResultSet resultSet)
protected void close(Statement statement)
protected void close(ResultSet resultSet)
protected String getSQLFormattedIdList(int listLength)
protected void rollback(Connection connection, String message)
public <E extends Exception> void transaction(ThrowingConsumer<Connection,E> command) throws DaoException
DaoExceptionpublic <R,E extends Exception> R transaction(ThrowingFunction<Connection,R,E> command) throws DaoException
DaoExceptionpublic <R,E extends Exception> R selectAndGetOperation(ThrowingFunction<Connection,R,E> command) throws DaoException
DaoExceptionpublic <E extends Exception> void selectOperation(ThrowingConsumer<Connection,E> command) throws DaoException
DaoExceptionCopyright © 2018 WSO2. All rights reserved.