public interface DataAccessObjectSession
extends java.io.Serializable
限定符和类型 | 方法和说明 |
---|---|
void |
addRelation(java.lang.Object relation,
java.lang.Class objClazz,
java.lang.Object objId,
RelationFCMapper relationMapper)
添加关联
|
void |
beginTransaction()
开始事务
|
void |
closeTransaction()
关闭
|
void |
commit()
提交
|
java.lang.Object |
convertDBValueToFieldValue(java.lang.Object value,
int type)
数据库值根据类型转为数据成员值
|
void |
delete(java.lang.Class clazz)
清空类绑定的数据表
|
void |
delete(java.lang.Object obj)
删除对象对应的数据库中的记录
|
void |
deleteAllRelation(java.lang.Class objClazz,
java.lang.Object objId,
RelationFCMapper relationMapper)
删除所有关联
|
boolean |
deleteByFields(java.lang.Class clazz,
java.util.Map<java.lang.String,java.lang.Object> fieldValueMap)
根据字段值删除记录
|
boolean |
deleteByPrimaryKey(java.lang.Class clazz,
long id)
删除主键对应的记录
|
JDBCDataAccessObjectOperator |
getManager() |
java.lang.Long |
getPrimaryKeyValue(java.lang.Object obj)
获取主键值
|
RelationObject |
getRelation(java.lang.Class objClazz,
RelationFCMapper relationMapper,
long relationID)
获取关联
|
java.util.List<RelationObject> |
getRelationByMap(java.lang.Class objClazz,
RelationFCMapper relationMapper,
java.util.Map<java.lang.String,java.lang.Object> map)
根据集合获取关联
|
boolean |
hasRelation(java.lang.Object relation,
java.lang.Class objClazz,
java.lang.Object objId,
RelationFCMapper relationMapper)
是否包含某个关联
|
void |
insert(java.lang.Object obj)
插入记录
|
<T> java.util.List<T> |
list(java.lang.Class<? extends T> clazz)
获取全部数据
|
<T> Page<T> |
list(java.lang.Class<? extends T> clazz,
PageConfiguration pageConfiguration)
获取分页数据
|
<T> Page<T> |
list(java.lang.Class<? extends T> clazz,
SortInfo si,
PageConfiguration pageConfiguration)
按某字段排序取数并分页
|
<T> java.util.List<T> |
list(java.lang.Class<T> clazz,
SortInfo si)
按某字段顺序取数
|
<T> java.util.List<T> |
listByFieldsAndSort(java.lang.Class<T> clazz,
java.lang.String[] fieldNames,
java.lang.Object[] fieldValues,
int[] compareTypes,
java.lang.String sortBy,
boolean asc)
根据一组字段数值比较进行取数并排序
|
<T> java.util.List<T> |
listByFieldValue(java.lang.Class<T> clazz,
java.lang.String fieldName,
java.lang.Object value)
根据某个字段值筛选值
|
<T> java.util.List<T> |
listByFieldValue(java.lang.Class<T> clazz,
java.lang.String fieldName,
java.lang.Object value,
int compareType)
根据某个字段判断筛选
|
<T> java.util.List<T> |
listByFieldValues(java.lang.Class<T> clazz,
java.util.Map<java.lang.String,java.lang.Object> fvMap)
根据某些字段值筛选数据
|
java.util.List<java.lang.Object> |
listByFieldValues4MVFilter(java.lang.Class clazz,
java.util.Map<java.lang.String,java.lang.Object> fvMap)
根据某些字段值筛选数据 传入的map中的值为数组时,会自动进行 in 处理
|
java.util.List<java.lang.Object> |
listFieldValue(java.lang.Class clazz,
java.lang.String fieldName)
取某一字段值列表
|
java.util.Set<java.lang.Object> |
listSetByRelationField(java.lang.Class objClazz,
java.lang.Object objId,
RelationFCMapper relationMapper,
boolean toObj)
根据字段关联获取对象集合
|
java.lang.Object |
load(java.lang.Class clazz,
long id)
加载
|
boolean |
removeRelation(java.lang.Class objClazz,
RelationFCMapper relationMapper,
long relationID)
移除关联
|
void |
removeRelation(java.lang.Object relation,
java.lang.Class objClazz,
java.lang.Object objId,
RelationFCMapper relationMapper)
移除关联
|
void |
rollback()
回滚
|
long |
save(java.lang.Object obj)
保存数据
|
boolean |
saveOrUpdate(java.lang.Object obj)
保存或者更新 有对应主键则是更新 否则是新加
|
boolean |
saveOrUpdateByFields(java.lang.Object obj,
java.util.Map<java.lang.String,java.lang.Object> map)
根据字段值save or update
|
void |
setForeignKeyChecks(int keyChecks)
设置外键约束
|
long |
transfer(java.lang.Object obj)
转移数据
|
boolean |
update(java.lang.Class clazz,
long id,
java.util.Map<java.lang.String,java.lang.Object> fvMap)
根据id更新数据
|
boolean |
update(java.lang.Class clazz,
java.util.Map<java.lang.String,java.lang.Object> fvMap)
更新数据不考虑主键
|
boolean |
update(java.lang.Object obj)
根据对象更新数据表数据
|
boolean |
updateByFields(java.lang.Object obj,
java.util.Map<java.lang.String,java.lang.Object> map)
根据字段值update
|
boolean |
updateRelation(java.lang.Class objClazz,
RelationFCMapper relationMapper,
long relationID,
java.util.Map<java.lang.Class,java.lang.Object> cvMap)
更新关联
|
void beginTransaction() throws java.lang.Exception
java.lang.Exception
void commit() throws java.lang.Exception
java.lang.Exception
void rollback() throws java.lang.Exception
java.lang.Exception
void closeTransaction()
void insert(java.lang.Object obj) throws DAOException
obj
- 要插入的对象DAOException
long save(java.lang.Object obj) throws DAOException
obj
- 对象DAOException
long transfer(java.lang.Object obj) throws DAOException
obj
- 对象DAOException
void addRelation(java.lang.Object relation, java.lang.Class objClazz, java.lang.Object objId, RelationFCMapper relationMapper) throws DAOException
relation
- 关联对象objClazz
- 类objId
- id值relationMapper
- 关联信息DAOException
RelationObject getRelation(java.lang.Class objClazz, RelationFCMapper relationMapper, long relationID) throws DAOException
objClazz
- 类relationMapper
- 关联信息relationID
- 关联idDAOException
boolean hasRelation(java.lang.Object relation, java.lang.Class objClazz, java.lang.Object objId, RelationFCMapper relationMapper) throws DAOException
relation
- 关联objClazz
- 类objId
- 值relationMapper
- 关联信息DAOException
boolean removeRelation(java.lang.Class objClazz, RelationFCMapper relationMapper, long relationID) throws DAOException
objClazz
- 类relationMapper
- 关联信息relationID
- 关联idDAOException
void removeRelation(java.lang.Object relation, java.lang.Class objClazz, java.lang.Object objId, RelationFCMapper relationMapper) throws DAOException
relation
- 关联objClazz
- 类objId
- 值relationMapper
- 关联信息DAOException
boolean saveOrUpdate(java.lang.Object obj) throws DAOException
obj
- 对象DAOException
boolean update(java.lang.Object obj) throws DAOException
obj
- 对象DAOException
boolean update(java.lang.Class clazz, long id, java.util.Map<java.lang.String,java.lang.Object> fvMap) throws DAOException
clazz
- 类id
- 主键idfvMap
- 更新字段值集合DAOException
boolean update(java.lang.Class clazz, java.util.Map<java.lang.String,java.lang.Object> fvMap) throws DAOException
clazz
- fvMap
- 更新字段值集合DAOException
boolean updateRelation(java.lang.Class objClazz, RelationFCMapper relationMapper, long relationID, java.util.Map<java.lang.Class,java.lang.Object> cvMap) throws DAOException
objClazz
- 类relationMapper
- 关联信息relationID
- 关联idcvMap
- 集合DAOException
java.lang.Object load(java.lang.Class clazz, long id) throws DAOException
clazz
- 类id
- 主键DAOException
<T> java.util.List<T> list(java.lang.Class<? extends T> clazz) throws DAOException
clazz
- 类DAOException
<T> Page<T> list(java.lang.Class<? extends T> clazz, PageConfiguration pageConfiguration)
clazz
- 类pageConfiguration
- 分页配置<T> Page<T> list(java.lang.Class<? extends T> clazz, SortInfo si, PageConfiguration pageConfiguration)
clazz
- 类si
- 排序依据pageConfiguration
- 分页配置<T> java.util.List<T> list(java.lang.Class<T> clazz, SortInfo si) throws DAOException
clazz
- 类si
- 排序依据DAOException
<T> java.util.List<T> listByFieldsAndSort(java.lang.Class<T> clazz, java.lang.String[] fieldNames, java.lang.Object[] fieldValues, int[] compareTypes, java.lang.String sortBy, boolean asc) throws DAOException
clazz
- 绑定类fieldNames
- 字段名数组fieldValues
- 字段值数组compareTypes
- 比较类型数组sortBy
- 排序字段名asc
- 是否是升序DAOException
java.util.List<java.lang.Object> listFieldValue(java.lang.Class clazz, java.lang.String fieldName) throws java.lang.Exception
clazz
- 绑定类fieldName
- 字段名java.lang.Exception
<T> java.util.List<T> listByFieldValue(java.lang.Class<T> clazz, java.lang.String fieldName, java.lang.Object value) throws DAOException
clazz
- 类fieldName
- 字段名value
- 字段值DAOException
<T> java.util.List<T> listByFieldValue(java.lang.Class<T> clazz, java.lang.String fieldName, java.lang.Object value, int compareType) throws DAOException
clazz
- 类fieldName
- 字段名value
- 字段值compareType
- 比较类型DAOException
<T> java.util.List<T> listByFieldValues(java.lang.Class<T> clazz, java.util.Map<java.lang.String,java.lang.Object> fvMap) throws DAOException
clazz
- 类fvMap
- 字段值集合DAOException
java.util.List<RelationObject> getRelationByMap(java.lang.Class objClazz, RelationFCMapper relationMapper, java.util.Map<java.lang.String,java.lang.Object> map) throws DAOException
objClazz
- 类relationMapper
- 关联信息map
- 集合DAOException
JDBCDataAccessObjectOperator getManager()
java.util.List<java.lang.Object> listByFieldValues4MVFilter(java.lang.Class clazz, java.util.Map<java.lang.String,java.lang.Object> fvMap) throws DAOException
clazz
- 类fvMap
- 字段值集合DAOException
java.util.Set<java.lang.Object> listSetByRelationField(java.lang.Class objClazz, java.lang.Object objId, RelationFCMapper relationMapper, boolean toObj) throws DAOException
objClazz
- 类objId
- 值relationMapper
- 关联信息toObj
- 当是间接关联时,即所查的关联表中的id值是否需要转换为对应对象。此参数不影响已经设定好的直接关联的情况。DAOException
void delete(java.lang.Class clazz) throws DAOException
clazz
- 类DAOException
void delete(java.lang.Object obj) throws DAOException
obj
- 对象DAOException
boolean deleteByPrimaryKey(java.lang.Class clazz, long id) throws DAOException
clazz
- 类id
- 主键idDAOException
boolean deleteByFields(java.lang.Class clazz, java.util.Map<java.lang.String,java.lang.Object> fieldValueMap) throws DAOException
clazz
- 类fieldValueMap
- 字段值集合DAOException
void deleteAllRelation(java.lang.Class objClazz, java.lang.Object objId, RelationFCMapper relationMapper) throws DAOException
objClazz
- 类objId
- 值relationMapper
- 关联DAOException
java.lang.Long getPrimaryKeyValue(java.lang.Object obj) throws DAOException
obj
- 类对象DAOException
java.lang.Object convertDBValueToFieldValue(java.lang.Object value, int type)
value
- 数据库值type
- 类型void setForeignKeyChecks(int keyChecks)
keyChecks
- 外键约束
DISABLE_FOREIGN_KEY_CHECKS 表示取消, ENABLE_FOREIGN_KEY_CHECKS 表示需要boolean updateByFields(java.lang.Object obj, java.util.Map<java.lang.String,java.lang.Object> map)
obj
- 类对象map
- 字段键值对boolean saveOrUpdateByFields(java.lang.Object obj, java.util.Map<java.lang.String,java.lang.Object> map)
obj
- 类对象map
- 字段键值对