public abstract class DbAccess<T extends DbAccess> extends Object implements IWoodKey, IQuery, Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
protected CacheUsing |
_cache |
protected String |
_woodKey |
String |
commandText |
DbContext |
context |
List<Variate> |
paramS |
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
buildWoodKey(Collection<Variate> args) |
protected T |
cache(CacheUsing cacheUsing) |
IQuery |
cacheTag(String tag)
为缓存添加标签
|
CacheUsing |
cacheUsing() |
IQuery |
caching(ICacheService service)
使用哪个缓存服务
|
int |
delete()
执行删除(返回受影响数)
|
protected Variate |
doGet(int index) |
protected Variate |
doGet(String paramName) |
protected void |
doSet(String param,
Object value) |
protected void |
doSet(Variate value) |
int |
execute()
执行命令(返回受影响数)
|
int[] |
executeBatch()
批量执行命令(返回受影响数)
|
<T> List<T> |
getArray(int columnIndex) |
<T> List<T> |
getArray(String column) |
protected abstract Command |
getCommand() |
protected abstract String |
getCommandID() |
long |
getCount() |
DataItem |
getDataItem() |
DataItem |
getDataItem(Act2<CacheUsing,DataItem> cacheCondition) |
DataList |
getDataList() |
DataList |
getDataList(Act2<CacheUsing,DataList> cacheCondition) |
<T> T |
getItem(Class<T> cls) |
<T> T |
getItem(Class<T> cls,
Act2<CacheUsing,T> cacheCondition) |
<T> List<T> |
getList(Class<T> cls) |
<T> List<T> |
getList(Class<T> cls,
Act2<CacheUsing,List<T>> cacheCondition) |
Map<String,Object> |
getMap() |
List<Map<String,Object>> |
getMapList() |
Object |
getValue() |
<T> T |
getValue(T def) |
Variate |
getVariate() |
Variate |
getVariate(Act2<CacheUsing,Variate> cacheCondition) |
String |
getWoodKey() |
long |
insert()
执行插入(返回自增ID)
|
T |
log(boolean isLog) |
T |
onCommandBuilt(Act1<Command> expr) |
protected void |
runCommandBuiltEvent(Command cmd) |
int |
update()
执行更新(返回受影响数)
|
IQuery |
usingCache(boolean isCache)
是否使用缓存
|
IQuery |
usingCache(int seconds)
使用缓存并设置时间
|
public String commandText
public DbContext context
protected String _woodKey
protected CacheUsing _cache
public DbAccess(DbContext context)
protected abstract Command getCommand() throws SQLException
SQLExceptionprotected abstract String getCommandID()
protected void runCommandBuiltEvent(Command cmd)
public String getWoodKey()
getWoodKey 在接口中 IWoodKeyprotected String buildWoodKey(Collection<Variate> args)
protected Variate doGet(int index)
protected void doSet(Variate value)
public T log(boolean isLog)
public long insert()
throws SQLException
SQLExceptionpublic int update()
throws SQLException
SQLExceptionpublic int delete()
throws SQLException
SQLExceptionpublic int execute()
throws SQLException
SQLExceptionpublic int[] executeBatch()
throws SQLException
SQLExceptionpublic long getCount()
throws SQLException
getCount 在接口中 IQuerySQLExceptionpublic Object getValue() throws SQLException
getValue 在接口中 IQuerySQLExceptionpublic <T> T getValue(T def)
throws SQLException
getValue 在接口中 IQuerySQLExceptionpublic Variate getVariate() throws SQLException
getVariate 在接口中 IQuerySQLExceptionpublic Variate getVariate(Act2<CacheUsing,Variate> cacheCondition) throws SQLException
getVariate 在接口中 IQuerySQLExceptionpublic <T> List<T> getArray(String column) throws SQLException
getArray 在接口中 IQuerySQLExceptionpublic <T> List<T> getArray(int columnIndex) throws SQLException
getArray 在接口中 IQuerySQLExceptionpublic <T> List<T> getList(Class<T> cls) throws SQLException
getList 在接口中 IQuerySQLExceptionpublic <T> List<T> getList(Class<T> cls, Act2<CacheUsing,List<T>> cacheCondition) throws SQLException
getList 在接口中 IQuerySQLExceptionpublic <T> T getItem(Class<T> cls) throws SQLException
getItem 在接口中 IQuerySQLExceptionpublic <T> T getItem(Class<T> cls, Act2<CacheUsing,T> cacheCondition) throws SQLException
getItem 在接口中 IQuerySQLExceptionpublic DataList getDataList() throws SQLException
getDataList 在接口中 IQuerySQLExceptionpublic DataList getDataList(Act2<CacheUsing,DataList> cacheCondition) throws SQLException
getDataList 在接口中 IQuerySQLExceptionpublic List<Map<String,Object>> getMapList() throws SQLException
getMapList 在接口中 IQuerySQLExceptionpublic DataItem getDataItem() throws SQLException
getDataItem 在接口中 IQuerySQLExceptionpublic DataItem getDataItem(Act2<CacheUsing,DataItem> cacheCondition) throws SQLException
getDataItem 在接口中 IQuerySQLExceptionpublic Map<String,Object> getMap() throws SQLException
getMap 在接口中 IQuerySQLExceptionpublic CacheUsing cacheUsing()
public IQuery caching(ICacheService service)
ICacheControllercaching 在接口中 ICacheController<IQuery>public IQuery usingCache(boolean isCache)
ICacheControllerusingCache 在接口中 ICacheController<IQuery>public IQuery usingCache(int seconds)
ICacheControllerusingCache 在接口中 ICacheController<IQuery>public IQuery cacheTag(String tag)
ICacheControllercacheTag 在接口中 ICacheController<IQuery>protected T cache(CacheUsing cacheUsing)
Copyright © 2023. All rights reserved.