Class MetadataEventSchemaCreator
java.lang.Object
io.hypersistence.optimizer.core.event.persistence.MetadataEventSchemaCreator
- All Implemented Interfaces:
EventSchemaCreator
The
MetadataEventSchemaCreator creates, on demand, the database tables used by the event
persistence feature.
Instead of hand-written DDL, it relies on Hibernate's own schema migrator: the Metadata of
the canonical entity model (HypersistenceOptimizerBootstrapRun,
HypersistenceOptimizerBootstrapEvent and HypersistenceOptimizerRuntimeEvent) is built
and the missing tables are created from it, so the tables are generated with the exact types and
identity strategy of the underlying database dialect, across every database Hibernate supports. The
short-lived service registry borrows connections from the host application's pool (via
HostConnectionProvider) and is destroyed immediately after the schema has been created; it is
only used for DDL, never to persist events (those are written with plain JDBC by
EventStore).
- Since:
- 2.14.0
- Author:
- Vlad Mihalcea
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidApply CREATE using the canonical IDENTITY mappings.
-
Constructor Details
-
MetadataEventSchemaCreator
-
-
Method Details
-
createSchema
public void createSchema()Apply CREATE using the canonical IDENTITY mappings. This does not introduce sequence generators.- Specified by:
createSchemain interfaceEventSchemaCreator
-