public abstract class GeneralJsonObjectDao extends Object implements JsonObjectDao
| 限定符和类型 | 类和说明 |
|---|---|
class |
GeneralJsonObjectDao.JSONObjectComparator |
| 构造器和说明 |
|---|
GeneralJsonObjectDao() |
GeneralJsonObjectDao(Connection conn) |
GeneralJsonObjectDao(Connection conn,
TableInfo tableInfo) |
GeneralJsonObjectDao(TableInfo tableInfo) |
| 限定符和类型 | 方法和说明 |
|---|---|
static org.apache.commons.lang3.tuple.Pair<String,String[]> |
buildFieldSql(TableInfo ti,
String alias)
返回 sql 语句 和 属性名数组
|
static String |
buildFilterSql(TableInfo ti,
String alias,
Collection<String> properties) |
static String |
buildFilterSqlByPk(TableInfo ti,
String alias) |
static org.apache.commons.lang3.tuple.Pair<String,String[]> |
buildGetObjectSqlByPk(TableInfo ti) |
boolean |
checkHasAllPkColumns(Map<String,Object> properties) |
int |
deleteObjectById(Map<String,Object> keyValues)
删除,联合主键
|
int |
deleteObjectById(Object keyValue)
删除,单主键
|
int |
deleteObjects(com.alibaba.fastjson.JSONArray objects)
批量删除
|
int |
deleteObjectsAsTabulation(Map<String,Object> properties)
根据外键批量删除,符合外键
|
int |
deleteObjectsAsTabulation(String propertyName,
Object propertyValue)
根据外键批量删除,单外键
|
int |
deleteObjectsByProperties(Map<String,Object> properties)
根据属性 批量删除
|
int |
doExecuteNamedSql(String sSql,
Map<String,Object> values)
执行一个带命名参数的sql语句
|
boolean |
doExecuteSql(String sSql) |
int |
doExecuteSql(String sSql,
Object[] values)
直接运行行带参数的 SQL,update delete insert
|
Long |
fetchObjectsCount(Map<String,Object> properties)
根据属性进行并获取总数
|
com.alibaba.fastjson.JSONArray |
findObjectsAsJSON(String sSql,
Object[] values,
String[] fieldnames) |
List<Object[]> |
findObjectsByNamedSql(String sSql,
Map<String,Object> values) |
com.alibaba.fastjson.JSONArray |
findObjectsByNamedSqlAsJSON(String sSql,
Map<String,Object> values,
String[] fieldnames) |
List<Object[]> |
findObjectsBySql(String sSql,
Object[] values)
查询带参数的SQL语句
|
Connection |
getConnect() |
com.alibaba.fastjson.JSONObject |
getObjectById(Map<String,Object> keyValues)
联合主键表
|
com.alibaba.fastjson.JSONObject |
getObjectById(Object keyValue)
单主键表
|
com.alibaba.fastjson.JSONObject |
getObjectByProperties(Map<String,Object> properties)
根据属性查询对象
|
Long |
getSimulateSequenceNextValue(String sequenceName)
用表来模拟sequence
create table simulate_sequence (seqname varchar(100) not null primary key,
currvalue integer, increment integer);
|
TableInfo |
getTableInfo() |
int |
insertObjectsAsTabulation(com.alibaba.fastjson.JSONArray objects)
批量添加多条记录
|
boolean |
isPkColumn(String propertyName) |
com.alibaba.fastjson.JSONArray |
listObjectsByProperties(Map<String,Object> properties) |
int |
mergeObject(Collection<String> fields,
Map<String,Object> object)
更改部分属性
|
int |
mergeObject(Map<String,Object> object)
合并
|
int |
replaceObjectsAsTabulation(com.alibaba.fastjson.JSONArray newObjects,
com.alibaba.fastjson.JSONArray dbObjects)
用新的列表覆盖数据库中的列表
|
int |
replaceObjectsAsTabulation(com.alibaba.fastjson.JSONArray newObjects,
Map<String,Object> properties)
用新的列表覆盖数据库中的内容,通过复合外键查询列表
|
int |
replaceObjectsAsTabulation(com.alibaba.fastjson.JSONArray newObjects,
String propertyName,
Object propertyValue)
用新的列表覆盖数据库中的内容,通过单外键查询列表
|
int |
saveNewObject(Map<String,Object> object) |
void |
setConnect(DBConnect conn) |
void |
setTableInfo(TableInfo tableInfo) |
int |
updateObject(Collection<String> fields,
Map<String,Object> object)
更改部分属性
|
int |
updateObject(Map<String,Object> object)
更改部分属性
|
int |
updateObjectsByProperties(Collection<String> fields,
Map<String,Object> fieldValues,
Map<String,Object> properties)
根据条件批量更新 对象
|
int |
updateObjectsByProperties(Map<String,Object> fieldValues,
Map<String,Object> properties)
根据条件批量更新 对象
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindObjectsAsJSON, findObjectsByNamedSql, findObjectsByNamedSqlAsJSON, findObjectsBySql, getSequenceNextValue, listObjectsByPropertiespublic GeneralJsonObjectDao()
public GeneralJsonObjectDao(TableInfo tableInfo)
public GeneralJsonObjectDao(Connection conn)
public GeneralJsonObjectDao(Connection conn, TableInfo tableInfo)
public void setConnect(DBConnect conn)
public Connection getConnect()
public void setTableInfo(TableInfo tableInfo)
public TableInfo getTableInfo()
getTableInfo 在接口中 JsonObjectDaopublic static org.apache.commons.lang3.tuple.Pair<String,String[]> buildFieldSql(TableInfo ti, String alias)
ti - TableInfoalias - Stringpublic boolean isPkColumn(String propertyName)
public static String buildFilterSql(TableInfo ti, String alias, Collection<String> properties)
public static org.apache.commons.lang3.tuple.Pair<String,String[]> buildGetObjectSqlByPk(TableInfo ti)
public com.alibaba.fastjson.JSONObject getObjectById(Object keyValue) throws SQLException, IOException
JsonObjectDaogetObjectById 在接口中 JsonObjectDaokeyValue - keyValueSQLException - SQLExceptionIOException - IOExceptionpublic com.alibaba.fastjson.JSONObject getObjectById(Map<String,Object> keyValues) throws SQLException, IOException
JsonObjectDaogetObjectById 在接口中 JsonObjectDaokeyValues - keyValuesSQLException - SQLExceptionIOException - IOExceptionpublic com.alibaba.fastjson.JSONObject getObjectByProperties(Map<String,Object> properties) throws SQLException, IOException
JsonObjectDaogetObjectByProperties 在接口中 JsonObjectDaoproperties - propertiesSQLException - SQLExceptionIOException - IOExceptionpublic com.alibaba.fastjson.JSONArray listObjectsByProperties(Map<String,Object> properties) throws SQLException, IOException
listObjectsByProperties 在接口中 JsonObjectDaoproperties - propertiesSQLException - SQLExceptionIOException - IOExceptionpublic Long fetchObjectsCount(Map<String,Object> properties) throws SQLException, IOException
JsonObjectDaofetchObjectsCount 在接口中 JsonObjectDaoproperties - propertiesSQLException - SQLExceptionIOException - IOExceptionpublic int saveNewObject(Map<String,Object> object) throws SQLException
saveNewObject 在接口中 JsonObjectDaoSQLExceptionpublic int updateObject(Collection<String> fields, Map<String,Object> object) throws SQLException
updateObject 在接口中 JsonObjectDaofields - 更改部分属性 属性名 集合,应为有的Map 不允许 值为null,这样这些属性 用map就无法修改为 nullobject - MapSQLException - SQLExceptionpublic int updateObject(Map<String,Object> object) throws SQLException
JsonObjectDaoupdateObject 在接口中 JsonObjectDaoobject - objectSQLException - SQLExceptionpublic int mergeObject(Collection<String> fields, Map<String,Object> object) throws SQLException, IOException
JsonObjectDaomergeObject 在接口中 JsonObjectDaofields - 更改部分属性 属性名 集合,应为有的Map 不允许 值为null,这样这些属性 用map就无法修改为 nullobject - objectSQLException - SQLExceptionIOException - IOExceptionpublic int mergeObject(Map<String,Object> object) throws SQLException, IOException
JsonObjectDaomergeObject 在接口中 JsonObjectDaoobject - objectSQLException - SQLExceptionIOException - IOExceptionpublic int updateObjectsByProperties(Collection<String> fields, Map<String,Object> fieldValues, Map<String,Object> properties) throws SQLException
JsonObjectDaoupdateObjectsByProperties 在接口中 JsonObjectDaofields - 更改部分属性 属性名 集合,应为有的Map 不允许 值为null,这样这些属性 用map就无法修改为 nullfieldValues - fieldValuesproperties - propertiesSQLException - SQLExceptionpublic int updateObjectsByProperties(Map<String,Object> fieldValues, Map<String,Object> properties) throws SQLException
JsonObjectDaoupdateObjectsByProperties 在接口中 JsonObjectDaofieldValues - propertiesproperties - propertiesSQLException - SQLExceptionpublic int deleteObjectById(Object keyValue) throws SQLException
JsonObjectDaodeleteObjectById 在接口中 JsonObjectDaokeyValue - keyValueSQLException - SQLExceptionpublic int deleteObjectById(Map<String,Object> keyValues) throws SQLException
JsonObjectDaodeleteObjectById 在接口中 JsonObjectDaokeyValues - keyValueSQLException - SQLExceptionpublic int deleteObjectsByProperties(Map<String,Object> properties) throws SQLException
JsonObjectDaodeleteObjectsByProperties 在接口中 JsonObjectDaoproperties - propertiesSQLException - SQLExceptionpublic int insertObjectsAsTabulation(com.alibaba.fastjson.JSONArray objects)
throws SQLException
JsonObjectDaoinsertObjectsAsTabulation 在接口中 JsonObjectDaoobjects - JSONArraySQLException - SQLExceptionpublic int deleteObjects(com.alibaba.fastjson.JSONArray objects)
throws SQLException
JsonObjectDaodeleteObjects 在接口中 JsonObjectDaoobjects - JSONArraySQLException - SQLExceptionpublic int deleteObjectsAsTabulation(String propertyName, Object propertyValue) throws SQLException
JsonObjectDaodeleteObjectsAsTabulation 在接口中 JsonObjectDaopropertyName - StringpropertyValue - ObjectSQLException - SQLExceptionpublic int deleteObjectsAsTabulation(Map<String,Object> properties) throws SQLException
JsonObjectDaodeleteObjectsAsTabulation 在接口中 JsonObjectDaoproperties - ObjectSQLException - SQLExceptionpublic int replaceObjectsAsTabulation(com.alibaba.fastjson.JSONArray newObjects,
com.alibaba.fastjson.JSONArray dbObjects)
throws SQLException
JsonObjectDaoreplaceObjectsAsTabulation 在接口中 JsonObjectDaonewObjects - JSONArraydbObjects - JSONArraySQLException - SQLExceptionpublic int replaceObjectsAsTabulation(com.alibaba.fastjson.JSONArray newObjects,
String propertyName,
Object propertyValue)
throws SQLException,
IOException
JsonObjectDaoreplaceObjectsAsTabulation 在接口中 JsonObjectDaonewObjects - JSONArraypropertyName - StringpropertyValue - ObjectSQLException - SQLExceptionIOException - IOExceptionpublic int replaceObjectsAsTabulation(com.alibaba.fastjson.JSONArray newObjects,
Map<String,Object> properties)
throws SQLException,
IOException
JsonObjectDaoreplaceObjectsAsTabulation 在接口中 JsonObjectDaonewObjects - newObjectsproperties - propertiesSQLException - SQLExceptionIOException - IOExceptionpublic Long getSimulateSequenceNextValue(String sequenceName) throws SQLException, IOException
sequenceName - sequenceNameSQLException - SQLExceptionIOException - IOExceptionpublic List<Object[]> findObjectsBySql(String sSql, Object[] values) throws SQLException, IOException
JsonObjectDaofindObjectsBySql 在接口中 JsonObjectDaosSql - Stringvalues - Object []SQLException - SQLExceptionIOException - IOExceptionpublic List<Object[]> findObjectsByNamedSql(String sSql, Map<String,Object> values) throws SQLException, IOException
findObjectsByNamedSql 在接口中 JsonObjectDaoSQLExceptionIOExceptionpublic com.alibaba.fastjson.JSONArray findObjectsAsJSON(String sSql, Object[] values, String[] fieldnames) throws SQLException, IOException
findObjectsAsJSON 在接口中 JsonObjectDaoSQLExceptionIOExceptionpublic com.alibaba.fastjson.JSONArray findObjectsByNamedSqlAsJSON(String sSql, Map<String,Object> values, String[] fieldnames) throws SQLException, IOException
findObjectsByNamedSqlAsJSON 在接口中 JsonObjectDaoSQLExceptionIOExceptionpublic boolean doExecuteSql(String sSql) throws SQLException
doExecuteSql 在接口中 JsonObjectDaoSQLExceptionpublic int doExecuteSql(String sSql, Object[] values) throws SQLException
doExecuteSql 在接口中 JsonObjectDaosSql - Stringvalues - Object[]SQLException - SQLExceptionpublic int doExecuteNamedSql(String sSql, Map<String,Object> values) throws SQLException
doExecuteNamedSql 在接口中 JsonObjectDaosSql - Stringvalues - valuesSQLException - SQLExceptionCopyright © 2017. All rights reserved.