Class AbstractEventTableFactory

java.lang.Object
org.axonframework.eventsourcing.eventstore.jdbc.AbstractEventTableFactory
All Implemented Interfaces:
EventTableFactory
Direct Known Subclasses:
HsqlEventTableFactory, MySqlEventTableFactory, Oracle11EventTableFactory, PostgresEventTableFactory

public abstract class AbstractEventTableFactory extends Object implements EventTableFactory
Abstract implementation of an EventTableFactory that provides Jdbc "create table" statements compatible with most databases.
Since:
3.0
Author:
Rene de Waele
  • Constructor Details

    • AbstractEventTableFactory

      public AbstractEventTableFactory()
  • Method Details

    • createDomainEventTable

      public PreparedStatement createDomainEventTable(Connection connection, EventSchema schema) throws SQLException
      Description copied from interface: EventTableFactory
      Creates a PreparedStatement that allows for the creation of the table to store Event entries.
      Specified by:
      createDomainEventTable in interface EventTableFactory
      Parameters:
      connection - The connection to create the PreparedStatement for
      schema - The event schema with the name of the table and its columns
      Returns:
      The statement to create the table, ready to be executed
      Throws:
      SQLException - when an exception occurs while creating the prepared statement
    • createSnapshotEventTable

      public PreparedStatement createSnapshotEventTable(Connection connection, EventSchema schema) throws SQLException
      Description copied from interface: EventTableFactory
      Creates a PreparedStatement that allows for the creation of the table to store Snapshots.
      Specified by:
      createSnapshotEventTable in interface EventTableFactory
      Parameters:
      connection - The connection to create the PreparedStatement for
      schema - The event schema with the name of the table and its columns
      Returns:
      The statement to create the table, ready to be executed
      Throws:
      SQLException - when an exception occurs while creating the prepared statement
    • idColumnType

      protected abstract String idColumnType()
      Returns the sql to register the auto incrementing global sequence column.
      Returns:
      the sql for the global id column
    • payloadType

      protected abstract String payloadType()
      Returns the sql to describe the type of payload column.
      Returns:
      the sql for the payload column
    • timestampType

      protected String timestampType()
      Returns the sql to describe the type of timestamp column.
      Returns:
      the sql for the timestamp column