- 所有超级接口:
AutoCloseable
Database service facade used by plugins and higher-level modules.
This API no longer uses ServiceLoader/SPI discovery. Create the concrete implementation directly in your runtime module (e.g. core) and pass it around via dependency injection.
Typical lifecycle:
- Construct implementation
init(DbType, DbConfig)to open connections- Obtain repositories via
repo(Class) - Optionally
migrate()schemas - Call
flushAll()on shutdown
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明default voidclose()Close the service.voidflushAll()Flush all pending changes to the underlying store.<T> voidFlush the repository of a specific entity type.voidinit(DataService.DbType type, DataService.DbConfig cfg) Initialize connection pool / driver by database type and config.voidmigrate()Perform pending schema migrations if supported by the implementation.<T,ID> Repository<T, ID> Obtain a repository for the annotated entity type.
-
方法详细资料
-
init
Initialize connection pool / driver by database type and config. -
repo
Obtain a repository for the annotated entity type.- 参数:
entityType- entity class- 返回:
- repository bound to that entity
-
migrate
void migrate()Perform pending schema migrations if supported by the implementation. No-op if unsupported. -
flushAll
void flushAll()Flush all pending changes to the underlying store. -
flushOf
Flush the repository of a specific entity type. -
close
default void close()Close the service. Default behaviour flushes all repositories.- 指定者:
close在接口中AutoCloseable
-