Package | Description |
---|---|
org.dromara.hutool.db |
Hutool-db是一个在JDBC基础上封装的数据库操作工具类,通过包装,使用ActiveRecord思想操作数据库。
|
Modifier and Type | Field and Description |
---|---|
protected Db |
DaoTemplate.db
SQL运行器
|
Modifier and Type | Method and Description |
---|---|
static Db |
Db.of()
创建Db
使用默认数据源,自动探测数据库连接池 |
static Db |
Db.of(DataSource ds)
创建Db
会根据数据源连接的元信息识别目标数据库类型,进而使用合适的数据源 |
static Db |
Db.of(DataSource ds,
Dialect dialect)
创建Db
|
static Db |
Db.of(DbConfig config)
创建Db
|
static Db |
Db.of(String group)
创建Db
使用默认数据源,自动探测数据库连接池 |
Db |
Db.tx(SerConsumer<Db> func)
执行事务,使用默认的事务级别
在同一事务中,所有对数据库操作都是原子的,同时提交或者同时回滚 |
Db |
Db.tx(TransactionLevel transactionLevel,
SerConsumer<Db> func)
执行事务
在同一事务中,所有对数据库操作都是原子的,同时提交或者同时回滚 |
Modifier and Type | Method and Description |
---|---|
Db |
Db.tx(SerConsumer<Db> func)
执行事务,使用默认的事务级别
在同一事务中,所有对数据库操作都是原子的,同时提交或者同时回滚 |
Db |
Db.tx(TransactionLevel transactionLevel,
SerConsumer<Db> func)
执行事务
在同一事务中,所有对数据库操作都是原子的,同时提交或者同时回滚 |
Constructor and Description |
---|
ActiveEntity(Db db,
Entity entity)
构造
|
ActiveEntity(Db db,
String tableName)
构造
|
DaoTemplate(String tableName,
String primaryKeyField,
Db db)
构造
|
Copyright © 2025. All rights reserved.