public final class DbKit extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DbKit.BatchInfo |
| Modifier and Type | Field and Description |
|---|---|
static int |
DB_BATCH_COUNT |
static int |
DEFAULT_TRANSACTION_LEVEL |
static String |
MAIN_CONFIG_NAME |
static String |
REPLICA_CONFIG_NAME |
| Modifier and Type | Method and Description |
|---|---|
static void |
addConfig(Config config)
Add Config object
|
static void |
addReplicaConfigs(List<Config> configs) |
static List<Integer> |
batchListSave(List<? extends Model> modelList) |
static List<Integer> |
batchListSave(List<? extends Model> modelList,
int batchSize,
String db)
原有框架方法更新只会取modelList第一个元素的字段状态,批量插入的SQL全部相同,只是参数值不同
本方法会根据modelList中所有元素,生成不同的SQL和参数,分批分别执行 自动过滤所有null值属性
|
static List<Integer> |
batchListSave(List<? extends Model> modelList,
String db) |
static List<Integer> |
batchListSave(String tableName,
List<? extends Row> recordList) |
static List<Integer> |
batchListSave(String tableName,
List<? extends Row> recordList,
int batchSize,
String db) |
static List<Integer> |
batchListUpdate(List<? extends Model> modelList) |
static List<Integer> |
batchListUpdate(List<? extends Model> modelList,
int batchSize,
String db)
原有框架方法更新只会取modelList第一个元素的字段状态,批量更新的SQL全部相同,只是参数值不同
本方法会根据modelList中所有元素,生成不同的SQL和参数,分批分别执行 自动过滤所有null值属性
|
static List<Integer> |
batchListUpdate(List<? extends Model> modelList,
String db) |
static StringBuilder |
buildInSqlPara(List<Object> paras,
StringBuilder sb,
Object[] inParas)
设置IN查询的sql和参数
|
static Config |
getConfig() |
static Config |
getConfig(Class<? extends Model> modelClass) |
static Config |
getConfig(String configName) |
static Set<Map.Entry<String,Config>> |
getConfigSet() |
static Config |
getReadConfig() |
static Class<? extends Model> |
getUsefulClass(Class<? extends Model> modelClass) |
static Config |
removeConfig(String configName) |
static Config |
useReplica() |
public static final int DB_BATCH_COUNT
public static final String MAIN_CONFIG_NAME
public static final String REPLICA_CONFIG_NAME
public static final int DEFAULT_TRANSACTION_LEVEL
public static void addConfig(Config config)
config - the Config contains DataSource, Dialect and so onpublic static Config getConfig()
public static Config getReadConfig()
public static Config useReplica()
public static Class<? extends Model> getUsefulClass(Class<? extends Model> modelClass)
public static List<Integer> batchListUpdate(List<? extends Model> modelList, int batchSize, String db)
modelList - batchSize - db - 使用的数据源,为空时使用默认:https://jfinal.com/share/2629public static List<Integer> batchListUpdate(List<? extends Model> modelList, String db)
public static List<Integer> batchListSave(List<? extends Model> modelList, int batchSize, String db)
modelList - batchSize - db - 使用的数据源,为空时使用默认:https://jfinal.com/share/2629public static List<Integer> batchListSave(String tableName, List<? extends Row> recordList, int batchSize, String db)
public static List<Integer> batchListSave(String tableName, List<? extends Row> recordList)
public static StringBuilder buildInSqlPara(List<Object> paras, StringBuilder sb, Object[] inParas)
paras - sb - inParas - Copyright © 2026. All rights reserved.