Class JdbcIdempotencyTableInitializer
java.lang.Object
io.github.ravocode.avoonce.jdbc.JdbcIdempotencyTableInitializer
Plain POJO that creates the
idempotency_records table if it does not
already exist.
This class has no framework dependencies. It operates
directly on a
DataSource using standard JDBC, and can be used from any runtime
environment:
- Spring Boot: The
idempotency-spring-boot-starterwraps this in anInitializingBeanand calls it automatically whenavoonce.idempotency.jdbc.auto-ddl=true(the default). - JAX-RS / CDI: Call
initialize(DataSource)from a@PostConstructmethod or an application lifecycle event. - Plain Java: Call
initialize(DataSource)at application startup before the first request is handled.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(DataSource dataSource) Creates theidempotency_recordstable and its index if they do not already exist.
-
Constructor Details
-
JdbcIdempotencyTableInitializer
public JdbcIdempotencyTableInitializer()
-
-
Method Details
-
initialize
Creates theidempotency_recordstable and its index if they do not already exist. Safe to call multiple times (idempotent).- Parameters:
dataSource- the JDBC data source to execute DDL against.- Throws:
IllegalStateException- if aSQLExceptionoccurs during DDL execution.
-