public class SqlGenerateUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
buildWhereConditionByPKs(List<String> pkNameList,
int rowSize,
String dbType) |
static String |
buildWhereConditionByPKs(List<String> pkNameList,
int rowSize,
String dbType,
int maxInSize)
each pk is a condition.the result will like :" (id,userCode) in ((?,?),(?,?)) or (id,userCode) in ((?,?),(?,?)
) or (id,userCode) in ((?,?))"
Build where condition by pks string.
|
static String |
buildWhereConditionByPKs(List<String> pkNameList,
String dbType)
each pk is a condition.the result will like :" id =? and userCode =?"
|
static void |
setParamForPk(List<Map<String,Field>> pkRowsList,
List<String> pkColumnNameList,
PreparedStatement pst)
set parameter for PreparedStatement, this is only used in pk sql.
|
public static String buildWhereConditionByPKs(List<String> pkNameList, int rowSize, String dbType) throws SQLException
SQLExceptionpublic static String buildWhereConditionByPKs(List<String> pkNameList, int rowSize, String dbType, int maxInSize) throws SQLException
pkNameList - pk column name listrowSize - the row size of recordsdbType - the type of databasemaxInSize - the max in sizeSQLException - the sql exceptionpublic static void setParamForPk(List<Map<String,Field>> pkRowsList, List<String> pkColumnNameList, PreparedStatement pst) throws SQLException
pkRowsList - pkRowsListpkColumnNameList - pkColumnNameListpst - preparedStatementSQLException - SQLExceptionpublic static String buildWhereConditionByPKs(List<String> pkNameList, String dbType)
pkNameList - pkNameListdbType - dbTypeCopyright © 2024 Apache. All rights reserved.