public class BeanDBSqlOperator<K> extends BeanDBBatchOperator<K> implements DbSqlOperator<K>
Modifier and Type | Field and Description |
---|---|
protected BeanOperatorManager |
manager |
jdbcTemplate
beanDbNameConverter, configuration, schema
DEFAULT_BEAN_TYPE
Constructor and Description |
---|
BeanDBSqlOperator() |
BeanDBSqlOperator(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
int |
account(Bean bean)
根据bean对象查询该bean对象的记录数
|
int |
account(String sql,
List<Object> parameters) |
int |
account(String sql,
Map<String,Object> parameters) |
int |
account(String sql,
Object... parameters) |
protected org.springframework.jdbc.core.SqlParameterValue |
createSqlParameter(Object value,
ColumnConfiguration primaryColumn) |
protected org.springframework.jdbc.core.SqlParameterValue[] |
createSqlParameterValue(Bean bean) |
protected org.springframework.jdbc.core.SqlParameterValue |
createSqlParamter(Object value,
ColumnConfiguration primaryColumn)
Deprecated.
|
int |
execute(String sql,
List<Object> parameters) |
int |
execute(String sql,
Map<String,Object> parameters)
执行带参数的sql语句
|
int |
execute(String sql,
Object... parameters)
执行带参数的sql语句
|
int |
getAutoIncreaseKey()
如果是自增长类型的Key返回新增加的值
|
Bean[] |
getBeans(Bean bean,
int start,
int limit)
分页查询bean
|
Bean[] |
getBeans(String sql) |
Bean[] |
getBeans(String sql,
List<Object> parameters) |
Bean[] |
getBeans(String sql,
Map<String,Object> parameters) |
Bean[] |
getBeans(String sql,
Object... parameters) |
protected List<String> |
getColumnNames(Bean bean)
获取操作的所有数据库字段名称
|
Bean[] |
getCursorPageBeans(String sql,
int start,
int limit) |
Bean[] |
getCursorPageBeans(String sql,
int start,
int limit,
List<Object> parameters) |
Bean[] |
getCursorPageBeans(String sql,
int start,
int limit,
Map<String,Object> parameters) |
Bean[] |
getCursorPageBeans(String sql,
int start,
int limit,
Object... parameters) |
protected List<Integer> |
getDataTypes(Bean bean)
获取操作的所有数据库字段类型
|
protected List<Integer> |
getDataTypes(List<ColumnConfiguration> paramsKeys) |
protected List<List<Object>> |
getDeleteParams(Bean[] beans) |
protected String |
getDeleteSqlByKey(String beanType) |
Bean[] |
getDialectPageBeans(String sql,
int start,
int limit) |
Bean[] |
getDialectPageBeans(String sql,
int start,
int limit,
List<Object> parameters) |
Bean[] |
getDialectPageBeans(String sql,
int start,
int limit,
Map<String,Object> parameters) |
Bean[] |
getDialectPageBeans(String sql,
int start,
int limit,
Object... parameters) |
protected List<org.springframework.jdbc.core.SqlParameterValue[]> |
getInsertParams(Bean[] beans) |
BeanOperatorManager |
getManager() |
Bean[] |
getPageBeans(String sql,
int start,
int limit) |
Bean[] |
getPageBeans(String sql,
int start,
int limit,
List<Object> parameters) |
Bean[] |
getPageBeans(String sql,
int start,
int limit,
Map<String,Object> parameters) |
Bean[] |
getPageBeans(String sql,
int start,
int limit,
Object... parameters) |
Pager |
getPager(Bean bean,
int start,
int limit)
分页查询bean
|
Pager |
getPager(String sql,
int start,
int limit) |
Pager |
getPager(String sql,
int start,
int limit,
List<Object> parameters) |
Pager |
getPager(String sql,
int start,
int limit,
Map<String,Object> parameters) |
Pager |
getPager(String sql,
int start,
int limit,
Object... parameters) |
protected List<Object> |
getParam(Bean bean,
List<ColumnConfiguration> paramsKeys) |
protected List<List<Object>> |
getParamList(Bean[] beans,
List<ColumnConfiguration> paramsKeys) |
protected List<Object> |
getParams(Bean bean) |
protected List<org.springframework.jdbc.core.SqlParameterValue[]> |
getParams(Bean[] beans,
org.springframework.jdbc.core.SqlParameterValue[] values) |
protected String |
getPrimaryFieldName(DbBaseOperator operator,
String beanType) |
protected String |
getPrimaryKeyValue(DbBaseOperator operator,
Bean bean)
获取主键值
|
protected String |
getQuerySql(String beanType) |
Relation |
getRelation(String beanType)
获取关联操作对象
|
String |
getSchema()
获取schame
|
Bean |
getSingleValue(String sql) |
Bean |
getSingleValue(String sql,
List<Object> parameters) |
Bean |
getSingleValue(String sql,
Map<String,Object> parameters) |
Bean |
getSingleValue(String sql,
Object... parameters) |
protected org.springframework.jdbc.core.SqlParameterValue[] |
getSqlParameterValue(Bean bean,
List<String> conditionColumns) |
protected org.springframework.jdbc.core.SqlParameterValue[] |
getSqlParameterValues(Bean bean) |
protected org.springframework.jdbc.core.SqlParameterValue[] |
getSqlParamterValue(Bean bean,
List<String> conditionColumns)
Deprecated.
|
protected String |
getTableNameWithSchame(String tableName) |
void |
setManager(BeanOperatorManager manager) |
batchDelete, batchDelete, batchDelete, batchDelete, batchInsert, batchInsert, batchInsert, batchInsert, batchUpdate, batchUpdate, batchUpdate, batchUpdate, deleteBean, deleteById, deleteById, executeBatch, executeBatchByList, executeBatchByList, executeBatchByMap, getBeans, getBeansById, getBeansById, insertBean, updateBean
beanNotExist, checkMoreToOne, checkOneToMore, createRelationBean, createRelationBeans, delete, deleteById, deleteTopBean, getBean, getRelationBeans, insert, insertTopBean, processRelation, relationProcess, update, update, updateTopBean
account, beginTransaction, checkNullParamList, commitTransaction, deleteNullParamList, execute, executeBatchBySqlParamterValues, executeBatchOperator, executeBatchOperator, executeByArray, executeByList, executeByMap, executeBySqlParameterValue, executeBySqlParameterValues, findBeans, findBeans, findBeansByList, findBeansByListForCursorPage, findBeansByListForDialectPage, findBeansByListForPage, findBeansByMap, findBeansByMapForCursorPage, findBeansByMapForDialectPage, findBeansByMapForPage, findBeansForCursorPage, findBeansForDialectPage, findBeansForPage, getBeanDbNameConverter, getDialect, getParamArray, getTransactionDefinition, getTransactionManager, getUniqueCode, operatorDebugLog, operatorDebugLogNoParam, operatorErrorLog, operatorErrorLogNoParam, queryForInt, queryForIntByList, queryForIntByMap, queryObject, queryObjectByMap, rollbackTransaction, setBeanDbNameConverter, setDialect, setJdbcTemplate, setTransactionDefinition, setTransactionManager
setConfiguration, setSchema, toDelete, toInsert, toSelect, toUpdate
checkBeanPropertyNull, getConditionParams, getConditionSql, getDeleteSql, getFullTableName, getInsertSql, getTableName, getUpdateSql
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBeanDbNameConverter, getDialect, getUniqueCode, setBeanDbNameConverter, setConfiguration, setDialect, setJdbcTemplate, setSchema
protected BeanOperatorManager manager
public BeanDBSqlOperator()
public BeanDBSqlOperator(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, Configuration configuration)
public Bean[] getBeans(String sql) throws TinyDbException
getBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getBeans(String sql, Map<String,Object> parameters) throws TinyDbException
getBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getPageBeans(String sql, int start, int limit, Map<String,Object> parameters) throws TinyDbException
getPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getBeans(String sql, Object... parameters) throws TinyDbException
getBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getBeans(String sql, List<Object> parameters) throws TinyDbException
getBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getPageBeans(String sql, int start, int limit, Object... parameters) throws TinyDbException
getPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getCursorPageBeans(String sql, int start, int limit) throws TinyDbException
getCursorPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getCursorPageBeans(String sql, int start, int limit, Map<String,Object> parameters) throws TinyDbException
getCursorPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getCursorPageBeans(String sql, int start, int limit, List<Object> parameters) throws TinyDbException
getCursorPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getCursorPageBeans(String sql, int start, int limit, Object... parameters) throws TinyDbException
getCursorPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getPageBeans(String sql, int start, int limit) throws TinyDbException
getPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getDialectPageBeans(String sql, int start, int limit) throws TinyDbException
getDialectPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getDialectPageBeans(String sql, int start, int limit, Object... parameters) throws TinyDbException
getDialectPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getPageBeans(String sql, int start, int limit, List<Object> parameters) throws TinyDbException
getPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getDialectPageBeans(String sql, int start, int limit, List<Object> parameters) throws TinyDbException
getDialectPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getDialectPageBeans(String sql, int start, int limit, Map<String,Object> parameters) throws TinyDbException
getDialectPageBeans
in interface DbSqlOperator<K>
TinyDbException
public Bean getSingleValue(String sql) throws TinyDbException
getSingleValue
in interface DbSqlOperator<K>
TinyDbException
public Bean getSingleValue(String sql, Map<String,Object> parameters) throws TinyDbException
getSingleValue
in interface DbSqlOperator<K>
TinyDbException
public Bean getSingleValue(String sql, Object... parameters) throws TinyDbException
getSingleValue
in interface DbSqlOperator<K>
TinyDbException
public Bean getSingleValue(String sql, List<Object> parameters) throws TinyDbException
getSingleValue
in interface DbSqlOperator<K>
TinyDbException
public int execute(String sql, Map<String,Object> parameters) throws TinyDbException
DbSqlOperator
execute
in interface DbSqlOperator<K>
TinyDbException
public int execute(String sql, Object... parameters) throws TinyDbException
DbSqlOperator
execute
in interface DbSqlOperator<K>
TinyDbException
public int execute(String sql, List<Object> parameters) throws TinyDbException
execute
in interface DbSqlOperator<K>
TinyDbException
public int account(String sql, Object... parameters) throws TinyDbException
account
in interface DbSqlOperator<K>
TinyDbException
public int account(String sql, List<Object> parameters) throws TinyDbException
account
in interface DbSqlOperator<K>
TinyDbException
public int account(String sql, Map<String,Object> parameters) throws TinyDbException
account
in interface DbSqlOperator<K>
TinyDbException
public Pager getPager(String sql, int start, int limit) throws TinyDbException
getPager
in interface DbSqlOperator<K>
TinyDbException
public Pager getPager(String sql, int start, int limit, Object... parameters) throws TinyDbException
getPager
in interface DbSqlOperator<K>
TinyDbException
public Pager getPager(String sql, int start, int limit, List<Object> parameters) throws TinyDbException
getPager
in interface DbSqlOperator<K>
TinyDbException
public Pager getPager(String sql, int start, int limit, Map<String,Object> parameters) throws TinyDbException
getPager
in interface DbSqlOperator<K>
TinyDbException
public Bean[] getBeans(Bean bean, int start, int limit) throws TinyDbException
DbSqlOperator
getBeans
in interface DbSqlOperator<K>
TinyDbException
public Pager getPager(Bean bean, int start, int limit) throws TinyDbException
DbSqlOperator
getPager
in interface DbSqlOperator<K>
TinyDbException
public int account(Bean bean) throws TinyDbException
DbSqlOperator
account
in interface DbSqlOperator<K>
TinyDbException
public int getAutoIncreaseKey() throws TinyDbException
DbBaseOperator
getAutoIncreaseKey
in interface DbBaseOperator
TinyDbException
protected String getDeleteSqlByKey(String beanType) throws TinyDbException
TinyDbException
protected List<String> getColumnNames(Bean bean)
getColumnNames
in class StatementTransformAdapter
bean
- protected List<Integer> getDataTypes(Bean bean)
bean
- protected org.springframework.jdbc.core.SqlParameterValue[] getSqlParameterValues(Bean bean)
protected List<Integer> getDataTypes(List<ColumnConfiguration> paramsKeys)
@Deprecated protected org.springframework.jdbc.core.SqlParameterValue createSqlParamter(Object value, ColumnConfiguration primaryColumn)
protected org.springframework.jdbc.core.SqlParameterValue createSqlParameter(Object value, ColumnConfiguration primaryColumn)
@Deprecated protected org.springframework.jdbc.core.SqlParameterValue[] getSqlParamterValue(Bean bean, List<String> conditionColumns) throws TinyDbException
TinyDbException
protected org.springframework.jdbc.core.SqlParameterValue[] getSqlParameterValue(Bean bean, List<String> conditionColumns) throws TinyDbException
TinyDbException
protected List<List<Object>> getParamList(Bean[] beans, List<ColumnConfiguration> paramsKeys)
protected List<Object> getParam(Bean bean, List<ColumnConfiguration> paramsKeys)
protected org.springframework.jdbc.core.SqlParameterValue[] createSqlParameterValue(Bean bean) throws TinyDbException
TinyDbException
protected List<org.springframework.jdbc.core.SqlParameterValue[]> getInsertParams(Bean[] beans) throws TinyDbException
TinyDbException
protected List<org.springframework.jdbc.core.SqlParameterValue[]> getParams(Bean[] beans, org.springframework.jdbc.core.SqlParameterValue[] values)
protected String getQuerySql(String beanType) throws TinyDbException
TinyDbException
protected String getTableNameWithSchame(String tableName)
getTableNameWithSchame
in class StatementTransformAdapter
public String getSchema()
DbBaseOperator
getSchema
in interface DbBaseOperator
getSchema
in class StatementTransformAdapter
public BeanOperatorManager getManager()
getManager
in interface DbBaseOperator
public void setManager(BeanOperatorManager manager)
setManager
in interface DbBaseOperator
public Relation getRelation(String beanType)
DbRelationOperator
getRelation
in interface DbRelationOperator
protected String getPrimaryFieldName(DbBaseOperator operator, String beanType) throws TinyDbException
TinyDbException
protected String getPrimaryKeyValue(DbBaseOperator operator, Bean bean) throws TinyDbException
operator
- bean
- TinyDbException
Copyright © 2006–2018 TinyGroup. All rights reserved.