Class AbstractJdbcDialectBuilder

java.lang.Object
io.agentscope.extensions.jdbc.dialect.AbstractJdbcDialectBuilder

public class AbstractJdbcDialectBuilder extends Object
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.

Author:
shanhongyu