AbstractJdbcDialectBuilder
public class AbstractJdbcDialectBuilder
io/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:48–190抽象 JDBC Dialect 构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.jdbc.dialect 包。核心成员包括 tablePrefix、storeTableName、sessionStateTableName、snapshotTableName、autoCreateTable、build。
Builder for AbstractJdbcDialect — chainable configuration then #build().
build() performs three steps: detect DB type via SPI → assemble table
names → optionally auto-create tables via AbstractJdbcDialect#createTableDdls().
The returned dialect instance does not hold a connection reference.
Detection uses JDK ServiceLoader to discover all AbstractJdbcDialect
implementations on the classpath. Candidates are sorted by
AbstractJdbcDialect#getOrder() (ascending); ties are broken by inheritance depth
(subclass before parent). The first candidate whose
AbstractJdbcDialect#supports(DatabaseMetaData) returns true wins.
Third-party extensions: place a
META-INF/services/io.agentscope.extensions.jdbc.dialect.AbstractJdbcDialect file
in your jar listing the dialect class name. Downstream projects add the dependency and
the dialect is auto-discovered — zero code changes.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public AbstractJdbcDialectBuilder tablePrefix(String tablePrefix) | 设置该配置项。 Sets the unified table prefix (default `agentscope_`). |
public AbstractJdbcDialectBuilder storeTableName(String name) | 设置该配置项。 Overrides the full KV store table name (takes priority over prefix + base). |
public AbstractJdbcDialectBuilder sessionStateTableName(String name) | 设置该配置项。 Overrides the full session-state table name. |
public AbstractJdbcDialectBuilder snapshotTableName(String name) | 设置该配置项。 Overrides the full snapshots table name. |
public AbstractJdbcDialectBuilder autoCreateTable(boolean autoCreateTable) | 设置该配置项。 Whether to auto-create tables during `#build()` (default true). |
public AbstractJdbcDialect build() | 构建并返回最终实例。 Detects the dialect, assembles table names, optionally creates tables. |
方法详情Method Detail
tablePrefix
public AbstractJdbcDialectBuilder tablePrefix(String tablePrefix)
设置该配置项。
Sets the unified table prefix (default agentscope_).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
tablePrefix | String | table Prefix(类型 `String`)。The table prefix. |
AbstractJdbcDialectBuilderio/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:70–73storeTableName
public AbstractJdbcDialectBuilder storeTableName(String name)
设置该配置项。
Overrides the full KV store table name (takes priority over prefix + base).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
AbstractJdbcDialectBuilderio/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:76–79sessionStateTableName
public AbstractJdbcDialectBuilder sessionStateTableName(String name)
设置该配置项。
Overrides the full session-state table name.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
AbstractJdbcDialectBuilderio/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:82–85snapshotTableName
public AbstractJdbcDialectBuilder snapshotTableName(String name)
设置该配置项。
Overrides the full snapshots table name.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
AbstractJdbcDialectBuilderio/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:88–91autoCreateTable
public AbstractJdbcDialectBuilder autoCreateTable(boolean autoCreateTable)
设置该配置项。
Whether to auto-create tables during #build() (default true).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
autoCreateTable | boolean | auto 创建 Table(类型 `boolean`)。The auto create table. |
AbstractJdbcDialectBuilderio/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:94–97build
public AbstractJdbcDialect build()
构建并返回最终实例。
Detects the dialect, assembles table names, optionally creates tables.
AbstractJdbcDialectio/agentscope/extensions/jdbc/dialect/AbstractJdbcDialectBuilder.java:100–115