public abstract class Database extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
Database(DataSource dataSource) |
| Modifier and Type | Method and Description |
|---|---|
static Txn |
beginTransaction() |
static Txn |
beginTransaction(Txn.Isolation isolation) |
static void |
commitTransaction() |
int |
countAll(Class<?> type) |
<T extends DaoBean> |
countUsingTemplate(T bean) |
<T extends DaoBean> |
countUsingTemplate(T bean,
int startRow,
int numRows) |
<T extends DaoBean> |
countUsingTemplate(T bean,
int startRow,
int numRows,
int searchType) |
int |
countWhere(Class<?> type,
String where) |
int |
countWhere(Class<?> type,
String where,
Object... fields) |
<T extends DaoBean> |
createBean(Class<T> type) |
static Txn |
currentTransaction() |
<T extends DaoBean> |
decodeResultSet(Class<T> type,
ResultSet rs,
int startRow,
int numRows) |
<T extends DaoBean> |
decodeRow(Class<T> type,
ResultSet rs) |
<T extends DaoBean> |
delete(T bean) |
int |
deleteAll(Class<?> type) |
int |
deleteByPrimaryKey(Class<?> type,
Integer id) |
int |
deleteByWhere(Class<?> type,
String where) |
int |
deleteByWhere(Class<?> type,
String where,
Object... fields) |
<T extends DaoBean> |
deleteUsingTemplate(T bean) |
static void |
endTransaction() |
DaoManager |
getManagerForClass(Class type) |
String |
getTableName(Class<?> type) |
<T extends DaoBean> |
insert(List<T> beans) |
<T extends DaoBean> |
insert(T bean) |
<T extends DaoBean> |
insert(T bean,
boolean orUpdate) |
<T extends DaoBean> |
insert(T bean,
boolean orUpdate,
boolean delayed) |
<T extends DaoBean> |
loadAll(Class<T> type) |
<T extends DaoBean> |
loadAll(Class<T> type,
int startRow,
int numRows) |
<T extends DaoBean> |
loadByPreparedStatement(Class<T> type,
PreparedStatement ps) |
<T extends DaoBean> |
loadByPreparedStatement(Class<T> type,
PreparedStatement ps,
int startRow,
int numRows) |
<T extends DaoBean> |
loadByPrimaryKey(Class<T> type,
Integer id) |
<T extends DaoBean> |
loadByWhere(Class<T> type,
String where) |
<T extends DaoBean> |
loadByWhere(Class<T> type,
String where,
int startRow,
int numRows) |
<T extends DaoBean> |
loadByWhere(Class<T> type,
String where,
Object... fields) |
<T extends DaoBean> |
loadUniqueByWhere(Class<T> type,
String where) |
<T extends DaoBean> |
loadUniqueByWhere(Class<T> type,
String where,
Object... fields) |
<T extends DaoBean> |
loadUniqueUsingTemplate(T bean) |
<T extends DaoBean> |
loadUsingTemplate(Class<T> type,
T bean) |
<T extends DaoBean> |
loadUsingTemplate(T bean,
int startRow,
int numRows) |
<T extends DaoBean> |
loadUsingTemplate(T bean,
int startRow,
int numRows,
int searchType) |
<T extends DaoBean> |
managerForClass(Class<T> type) |
<T extends DaoBean> |
metaDataDecodeRow(Class<T> type,
ResultSet rs) |
protected void |
registerManager(DaoManager manager) |
static void |
rollbackTransaction() |
<T extends DaoBean> |
save(List<T> beans) |
<T extends DaoBean> |
save(T bean) |
<T extends DaoBean> |
update(List<T> beans) |
<T extends DaoBean> |
update(T bean) |
protected Database(DataSource dataSource)
protected void registerManager(DaoManager manager)
public <T extends DaoBean> DaoManager<T> managerForClass(Class<T> type)
public DaoManager getManagerForClass(Class type)
public <T extends DaoBean> T loadByPrimaryKey(Class<T> type, Integer id) throws SQLException
SQLExceptionpublic int deleteByPrimaryKey(Class<?> type, Integer id) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> loadAll(Class<T> type) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> loadAll(Class<T> type, int startRow, int numRows) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> loadByWhere(Class<T> type, String where) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> loadByWhere(Class<T> type, String where, Object... fields) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> loadByWhere(Class<T> type, String where, int startRow, int numRows) throws SQLException
SQLExceptionpublic <T extends DaoBean> T loadUniqueByWhere(Class<T> type, String where) throws SQLException
SQLExceptionpublic <T extends DaoBean> T loadUniqueByWhere(Class<T> type, String where, Object... fields) throws SQLException
SQLExceptionpublic int deleteAll(Class<?> type) throws SQLException
SQLExceptionpublic int deleteByWhere(Class<?> type, String where) throws SQLException
SQLExceptionpublic int deleteByWhere(Class<?> type, String where, Object... fields) throws SQLException
SQLExceptionpublic <T extends DaoBean> T save(T bean) throws SQLException
SQLExceptionpublic <T extends DaoBean> T insert(T bean) throws SQLException
SQLExceptionpublic <T extends DaoBean> T insert(T bean, boolean orUpdate) throws SQLException
SQLExceptionpublic <T extends DaoBean> T insert(T bean, boolean orUpdate, boolean delayed) throws SQLException
SQLExceptionpublic <T extends DaoBean> T update(T bean) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> save(List<T> beans) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> insert(List<T> beans) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> update(List<T> beans) throws SQLException
SQLExceptionpublic <T extends DaoBean> T loadUniqueUsingTemplate(T bean) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> loadUsingTemplate(Class<T> type, T bean) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> loadUsingTemplate(T bean, int startRow, int numRows) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> loadUsingTemplate(T bean, int startRow, int numRows, int searchType) throws SQLException
SQLExceptionpublic <T extends DaoBean> boolean delete(T bean) throws SQLException
SQLExceptionpublic <T extends DaoBean> int deleteUsingTemplate(T bean) throws SQLException
SQLExceptionpublic int countAll(Class<?> type) throws SQLException
SQLExceptionpublic int countWhere(Class<?> type, String where) throws SQLException
SQLExceptionpublic int countWhere(Class<?> type, String where, Object... fields) throws SQLException
SQLExceptionpublic <T extends DaoBean> int countUsingTemplate(T bean) throws SQLException
SQLExceptionpublic <T extends DaoBean> int countUsingTemplate(T bean, int startRow, int numRows) throws SQLException
SQLExceptionpublic <T extends DaoBean> int countUsingTemplate(T bean, int startRow, int numRows, int searchType) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> decodeResultSet(Class<T> type, ResultSet rs, int startRow, int numRows) throws SQLException
SQLExceptionpublic <T extends DaoBean> T decodeRow(Class<T> type, ResultSet rs) throws SQLException
SQLExceptionpublic <T extends DaoBean> T metaDataDecodeRow(Class<T> type, ResultSet rs) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> loadByPreparedStatement(Class<T> type, PreparedStatement ps) throws SQLException
SQLExceptionpublic <T extends DaoBean> List<T> loadByPreparedStatement(Class<T> type, PreparedStatement ps, int startRow, int numRows) throws SQLException
SQLExceptionpublic static Txn beginTransaction()
public static Txn beginTransaction(Txn.Isolation isolation)
public static Txn currentTransaction()
public static void commitTransaction()
public static void endTransaction()
public static void rollbackTransaction()
Copyright © 2014. All Rights Reserved.