public interface PreparedSql extends CommOperate
If possible, it is recommended to use object-oriented operation methods, such as Suid and SuidRich.
It can use Bee cache to achieve higher query efficiency.
Notice:
PreparedSql method which no T parameter, is not associated with entity, in the case of
multiple dataSource, will be select the record from the default dataSource.
from V1.11 version, can set the dataSource name.
Support map parameter forms such as name = #{name}, name like #{name%}
, 1.2
| Modifier and Type | Method and Description |
|---|---|
int |
insertBatch(String sql,
List<Map<String,Object>> parameterMapList)
Insert records by batch type.
|
int |
insertBatch(String sql,
List<Map<String,Object>> parameterMapList,
int batchSize)
Insert records by batch type and batchSize.
|
int |
modify(String sql)
Deprecated.
It is not recommended because the framework does not know what table has been changed,
which will affect the correctness of the cache and cause the risk of inaccurate cache data. |
int |
modify(String sql,
Map<String,Object> map)
Deprecated.
It is not recommended because
the framework does not know what table has been changed, which will affect the correctness of the cache and
cause the risk of inaccurate cache data.
|
int |
modify(String sql,
Object[] preValues)
Deprecated.
It is not recommended because
the framework does not know what table has been changed, which will affect the correctness of the cache and cause the risk of inaccurate cache data. |
<T> List<T> |
moreTableSelect(String sql,
T returnType)
Select more table record(s) via no placeholder(?) select statement.
|
<T> List<T> |
moreTableSelect(String sqlStr,
T entity,
Map<String,Object> parameterMap)
Select the more table record(s) via the placeholder statement of variable.
|
<T> List<T> |
moreTableSelect(String sqlStr,
T entity,
Map<String,Object> parameterMap,
int start,
int size)
Select the more table record(s) via the placeholder statement of variable.Both entity and map can pass values to parameters.
|
List<String[]> |
select(String sql)
Select record(s) via the sql statement.
|
List<String[]> |
select(String sqlStr,
Map<String,Object> map)
Select and transform every record to string array.
|
List<String[]> |
select(String sqlStr,
Map<String,Object> map,
int start,
int size)
Select and transform every record to string array.
|
List<String[]> |
select(String sql,
Object[] preValues)
Select and transform every record to string array.
|
List<String[]> |
select(String sql,
Object[] preValues,
int start,
int size)
Select and transform every record to string array.
|
<T> List<T> |
select(String sql,
T returnType)
Select record(s) via no placeholder(?) select statement.
|
<T> List<T> |
select(String sqlStr,
T entity,
Map<String,Object> parameterMap)
Select the record(s) via the placeholder statement of variable.Both entity and map can pass values to parameters. |
<T> List<T> |
select(String sqlStr,
T entity,
Map<String,Object> parameterMap,
int start,
int size)
Select the record(s) via the placeholder statement of variable.Both entity and map can pass values to parameters.
|
<T> List<T> |
select(String sql,
T returnType,
Object[] preValues)
Select record(s) via the placeholder(?) statement.
|
<T> List<T> |
select(String sql,
T returnType,
Object[] preValues,
int start,
int size)
Select record(s) via the placeholder(?) statement,paging generate by Bee.
|
String |
selectFun(String sql)
Select result with function.
|
String |
selectFun(String sqlStr,
Map<String,Object> parameterMap)
Select result with function.
|
String |
selectFun(String sql,
Object[] preValues)
Select result with function.
|
String |
selectJson(String sqlStr)
Select and return json format result.
|
String |
selectJson(String sqlStr,
Map<String,Object> map)
Select and return json format result.
|
String |
selectJson(String sqlStr,
Map<String,Object> map,
int start,
int size)
Select and return json format result.
|
String |
selectJson(String sql,
Object[] preValues)
Select and return json format result.
|
String |
selectJson(String sql,
Object[] preValues,
int start,
int size)
Select and return json format result.
|
List<Map<String,Object>> |
selectMapList(String sql)
Query records and return list structure data whose element is Map
|
List<Map<String,Object>> |
selectMapList(String sqlStr,
Map<String,Object> parameterMap)
Query records and return list structure data whose element is Map
|
List<Map<String,Object>> |
selectMapList(String sql,
Map<String,Object> parameterMap,
int start,
int size)
Query records and return list structure data whose element is Map
|
<T> List<T> |
selectSomeField(String sqlStr,
T entity,
Map<String,Object> parameterMap)
Select some column of the record(s) via the placeholder statement of variable.Both entity and map can pass values to parameters.
|
<T> List<T> |
selectSomeField(String sqlStr,
T entity,
Map<String,Object> parameterMap,
int start,
int size)
Select some column of the record(s) via the placeholder statement of variable.Both entity and map can pass values to parameters.
|
<T> List<T> |
selectSomeField(String sql,
T returnType,
Object[] preValues)
Select some column of record(s) via the placeholder(?) statement.
eg: select * from orders where userid=? |
<T> List<T> |
selectSomeField(String sql,
T returnType,
Object[] preValues,
int start,
int size)
Select some column of record(s) via the placeholder(?) statement,paging generate by Bee.
|
getDataSourceName, getInterceptorChain, setDataSourceName, setNameTranslateOneTime<T> List<T> select(String sql, T returnType, Object[] preValues)
sql - SQL select statement which direct use ? as placeholderreturnType - its type same as list element.preValues - An object array that values set for the SQL placeholders in index order.<T> List<T> select(String sql, T returnType)
sql - SQL select statement(no placeholder).returnType - its type same as list element.<T> List<T> select(String sql, T returnType, Object[] preValues, int start, int size)
sql - SQL select statement(use ? placeholder).returnType - its type same as list element.preValues - An object array that values set for the SQL placeholders in index order.start - Start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - Fetch result size (>0).<T> List<T> select(String sqlStr, T entity, Map<String,Object> parameterMap)
sqlStr - SQL select statement(use #{para} placeholder).entity - The non null value in entity will be converted into the element of map as the parameter,
parameterMap - The parameters of map structure correspond, the variable name in sqlstr correspond the key of map.
<T> List<T> select(String sqlStr, T entity, Map<String,Object> parameterMap, int start, int size)
sqlStr - SQL select statement(use #{para} placeholder).entity - The non null value in entity will be converted into the element of map as the parameter,
parameterMap - The parameters of map structure correspond, the variable name in sqlstr correspond the key of map.
start - Start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - Fetch result size (>0).<T> List<T> selectSomeField(String sql, T returnType, Object[] preValues)
sql - SQL select statement(use ? placeholder).returnType - its type same as list element.preValues - An object array that values set for the SQL placeholders in index order.<T> List<T> selectSomeField(String sql, T returnType, Object[] preValues, int start, int size)
eg: select * from orders where userid=?
sql - SQL select statement(use ? placeholder).returnType - its type same as list element.preValues - An object array that values set for the SQL placeholders in index order.start - Start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - Fetch result size (>0).<T> List<T> selectSomeField(String sqlStr, T entity, Map<String,Object> parameterMap)
sqlStr - SQL select statement(use #{para} placeholder).entity - The non null value in entity will be converted into the element of map as the parameter,
parameterMap - The parameters of map structure correspond, the variable name in sqlstr correspond the key of map.
<T> List<T> selectSomeField(String sqlStr, T entity, Map<String,Object> parameterMap, int start, int size)
paging generate by Bee
eg:select * from orders where userid=#{userid}
eg:select * from orders where name like #{name%}
sqlStr - SQL select statement(use #{para} placeholder).entity - The non null value in entity will be converted into the element of map as the parameter,
parameterMap - The parameters of map structure correspond, the variable name in sqlstr correspond the key of map.
start - Start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - Fetch result size (>0).String selectFun(String sql, Object[] preValues)
Notice:can not use the cache because don't relay the entity.
Because it is not associated with entity, in the case of multiple dataSource,
will be select the record from the default dataSource.
sql - SQL select statement(use ? placeholder).preValues - An object array that values set for the SQL placeholders in index order.String selectFun(String sqlStr, Map<String,Object> parameterMap)
Notice:can not use the cache because don't relay the entity.
Because it is not associated with entity, in the case of multiple dataSource,
will be select the record from the default dataSource.
sqlStr - SQL select statementparameterMap - The parameters of map structure correspond, the variable name in sqlStr correspond the key of map.List<String[]> select(String sql, Object[] preValues)
Notice:can not use the cache because don't relay the entity.
Because it is not associated with entity, in the case of multiple dataSource,
will be select the record from the default dataSource.
sql - SQL select statement(use ? placeholder).preValues - parameter values for placeholderList<String[]> select(String sql, Object[] preValues, int start, int size)
sql - SQL select statement(use ? placeholder).preValues - parameter values for placeholderstart - Start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - Fetch result size (>0).List<String[]> select(String sqlStr, Map<String,Object> map)
sqlStr - SQL select statementmap - parameter values for placeholderList<String[]> select(String sqlStr, Map<String,Object> map, int start, int size)
sqlStr - SQL select statementmap - parameter values for placeholderstart - Start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - Fetch result size (>0).String selectJson(String sql, Object[] preValues)
sql - SQL select statement(use ? placeholder).preValues - parameter values for placeholderString selectJson(String sql, Object[] preValues, int start, int size)
sql - SQL select statement(use ? placeholder).preValues - parameter values for placeholderstart - Start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - Fetch result size (>0).String selectJson(String sqlStr, Map<String,Object> map)
sqlStr - SQL select statementmap - parameter values for placeholderString selectJson(String sqlStr, Map<String,Object> map, int start, int size)
sqlStr - SQL select statementmap - parameter values for placeholderstart - Start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - Fetch result size (>0).String selectJson(String sqlStr)
Notice:can not use the cache because don't relay the entity.
Because it is not associated with entity, in the case of multiple dataSource,
will be select the record from the default dataSource.
sqlStr - SQL select statement(do not contain placeholder)List<String[]> select(String sql)
sql - SQL select statement(do not contain placeholder)String selectFun(String sql)
Notice:can not use the cache because don't relay the entity.
Because it is not associated with entity, in the case of multiple dataSource,
will be select the record from the default dataSource.
sql - SQL select statement(do not contain placeholder)@Deprecated int modify(String sql, Object[] preValues)
sql - SQL select statement(use ? placeholder).preValues - parameter values for placeholder@Deprecated int modify(String sql, Map<String,Object> map)
sql - SQL statement.map - parameter values for placeholder@Deprecated int modify(String sql)
sql - SQL statement.List<Map<String,Object>> selectMapList(String sql)
sql - SQL statement(do not contain placeholder).List<Map<String,Object>> selectMapList(String sqlStr, Map<String,Object> parameterMap)
sqlStr - SQL statement.parameterMap - The parameters of map structure correspond, the variable name in sqlStr correspond the key of map.List<Map<String,Object>> selectMapList(String sql, Map<String,Object> parameterMap, int start, int size)
sql - SQL statement.parameterMap - start - Start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - Fetch result size (>0).<T> List<T> moreTableSelect(String sql, T returnType)
sql - SQL select statement(no placeholder).returnType - its type same as list element.<T> List<T> moreTableSelect(String sqlStr, T entity, Map<String,Object> parameterMap)
sqlStr - SQL select statement(use #{para} placeholder).entity - The non null value in entity will be converted into the element of map as the parameter,
parameterMap - The parameters of map structure correspond, the variable name in sqlstr correspond the key of map.
<T> List<T> moreTableSelect(String sqlStr, T entity, Map<String,Object> parameterMap, int start, int size)
sqlStr - SQL select statement(use #{para} placeholder).entity - The non null value in entity will be converted into the element of map as the parameter,
parameterMap - The parameters of map structure correspond, the variable name in sqlstr correspond the key of map.
start - Start index,min value is 0 or 1(eg:MySQL is 0,Oracle is 1).size - Fetch result size (>0).int insertBatch(String sql, List<Map<String,Object>> parameterMapList)
sql - parameterMapList - every element of List is a map corresponds to one record, every field add in map struct.int insertBatch(String sql, List<Map<String,Object>> parameterMapList, int batchSize)
sql - parameterMapList - every element of List is a map corresponds to one record, every field add in map struct.batchSize - Copyright © 2023. All rights reserved.