T
- The data type used to store serialized objectspublic interface EventSqlSchema<T>
Modifier and Type | Method and Description |
---|---|
SerializedDomainEventData<T> |
createSerializedDomainEventData(ResultSet resultSet)
Reads the current entry of the ResultSet into a SerializedDomainEventData.
|
Class<T> |
getDataType()
Returns the type used to store serialized payloads.
|
PreparedStatement |
sql_createDomainEventEntryTable(Connection connection)
Creates a PreparedStatement that allows for the creation of the table to store Event entries.
|
PreparedStatement |
sql_createSnapshotEventEntryTable(Connection connection)
Creates a PreparedStatement that allows for the creation of the table to store Snapshots.
|
Object |
sql_dateTime(org.joda.time.DateTime input)
Converts a
DateTime to a data value suitable for the database scheme. |
PreparedStatement |
sql_fetchFromSequenceNumber(Connection connection,
String type,
Object aggregateIdentifier,
long firstSequenceNumber)
Creates a PreparedStatement that fetches event data for an aggregate with given
type and
identifier , starting at the given firstSequenceNumber . |
PreparedStatement |
sql_findSnapshotSequenceNumbers(Connection connection,
String type,
Object aggregateIdentifier)
Creates a PreparedStatement that returns the sequence numbers of snapshots for an aggregate of given
type and aggregateIdentifier . |
PreparedStatement |
sql_getFetchAll(Connection connection,
String whereClause,
Object[] parameters)
Creates a PreparedStatement that fetches all event messages matching the given
whereClause . |
PreparedStatement |
sql_insertDomainEventEntry(Connection connection,
String eventIdentifier,
String aggregateIdentifier,
long sequenceNumber,
org.joda.time.DateTime timestamp,
String eventType,
String eventRevision,
T eventPayload,
T eventMetaData,
String aggregateType)
Creates the PreparedStatement for inserting a DomainEvent in the Event Store, using given attributes.
|
PreparedStatement |
sql_insertSnapshotEventEntry(Connection connection,
String eventIdentifier,
String aggregateIdentifier,
long sequenceNumber,
org.joda.time.DateTime timestamp,
String eventType,
String eventRevision,
T eventPayload,
T eventMetaData,
String aggregateType)
Creates the PreparedStatement for inserting a Snapshot Event in the Event Store, using given attributes.
|
PreparedStatement |
sql_loadLastSnapshot(Connection connection,
Object identifier,
String aggregateType)
Creates the PreparedStatement for loading the last snapshot event for an aggregate with given
identifier and of given aggregateType . |
PreparedStatement |
sql_pruneSnapshots(Connection connection,
String type,
Object aggregateIdentifier,
long sequenceOfFirstSnapshotToPrune)
Creates a PreparedStatement that deletes all snapshots with a sequence identifier equal or lower to the given
sequenceOfFirstSnapshotToPrune , for an aggregate of given type and
aggregateIdentifier . |
PreparedStatement sql_loadLastSnapshot(Connection connection, Object identifier, String aggregateType) throws SQLException
identifier
and of given aggregateType
.connection
- The connection to create the PreparedStatement foridentifier
- The identifier of the aggregate to find the snapshot foraggregateType
- The type identifier of the aggregateSQLException
- when an exception occurs while creating the prepared statementPreparedStatement sql_insertDomainEventEntry(Connection connection, String eventIdentifier, String aggregateIdentifier, long sequenceNumber, org.joda.time.DateTime timestamp, String eventType, String eventRevision, T eventPayload, T eventMetaData, String aggregateType) throws SQLException
connection
- The connection to create the PreparedStatement foreventIdentifier
- The unique identifier of the eventaggregateIdentifier
- The identifier of the aggregate that generated the eventsequenceNumber
- The sequence number of the eventtimestamp
- The time at which the Event Message was generatedeventType
- The type identifier of the serialized eventeventRevision
- The revision of the serialized eventeventPayload
- The serialized payload of the EventeventMetaData
- The serialized meta data of the eventaggregateType
- The type identifier of the aggregate the event belongs toSQLException
- when an exception occurs while creating the prepared statementPreparedStatement sql_insertSnapshotEventEntry(Connection connection, String eventIdentifier, String aggregateIdentifier, long sequenceNumber, org.joda.time.DateTime timestamp, String eventType, String eventRevision, T eventPayload, T eventMetaData, String aggregateType) throws SQLException
connection
- The connection to create the PreparedStatement foreventIdentifier
- The unique identifier of the eventaggregateIdentifier
- The identifier of the aggregate that generated the eventsequenceNumber
- The sequence number of the eventtimestamp
- The time at which the Event Message was generatedeventType
- The type identifier of the serialized eventeventRevision
- The revision of the serialized eventeventPayload
- The serialized payload of the EventeventMetaData
- The serialized meta data of the eventaggregateType
- The type identifier of the aggregate the event belongs toSQLException
- when an exception occurs while creating the prepared statementPreparedStatement sql_pruneSnapshots(Connection connection, String type, Object aggregateIdentifier, long sequenceOfFirstSnapshotToPrune) throws SQLException
sequenceOfFirstSnapshotToPrune
, for an aggregate of given type
and
aggregateIdentifier
.connection
- The connection to create the PreparedStatement fortype
- The type identifier of the aggregateaggregateIdentifier
- The identifier of the aggregatesequenceOfFirstSnapshotToPrune
- The sequence number of the most recent snapshot to pruneSQLException
- when an exception occurs while creating the prepared statementPreparedStatement sql_findSnapshotSequenceNumbers(Connection connection, String type, Object aggregateIdentifier) throws SQLException
type
and aggregateIdentifier
.connection
- The connection to create the PreparedStatement fortype
- The type identifier of the aggregateaggregateIdentifier
- The identifier of the aggregateSQLException
- when an exception occurs while creating the prepared statementPreparedStatement sql_fetchFromSequenceNumber(Connection connection, String type, Object aggregateIdentifier, long firstSequenceNumber) throws SQLException
type
and
identifier
, starting at the given firstSequenceNumber
.connection
- The connection to create the PreparedStatement fortype
- The type identifier of the aggregateaggregateIdentifier
- The identifier of the aggregatefirstSequenceNumber
- The sequence number of the first event to returncreateSerializedDomainEventData(java.sql.ResultSet)
SQLException
- when an exception occurs while creating the prepared statementPreparedStatement sql_getFetchAll(Connection connection, String whereClause, Object[] parameters) throws SQLException
whereClause
. The
given parameters
provide the parameters used in the where clause, in the order of declaration.connection
- The connection to create the PreparedStatement forwhereClause
- The SQL snippet to use after the WHERE directive. May be null
or an empty String
to indicate that no filter is to be appliedparameters
- The parameters to set in the WHERE clausecreateSerializedDomainEventData(java.sql.ResultSet)
SQLException
- when an exception occurs while creating the prepared statementPreparedStatement sql_createSnapshotEventEntryTable(Connection connection) throws SQLException
connection
- The connection to create the PreparedStatement forSQLException
- when an exception occurs while creating the prepared statementPreparedStatement sql_createDomainEventEntryTable(Connection connection) throws SQLException
connection
- The connection to create the PreparedStatement forSQLException
- when an exception occurs while creating the prepared statementSerializedDomainEventData<T> createSerializedDomainEventData(ResultSet resultSet) throws SQLException
resultSet
- The result set returned from executing one of the Prepared Statements declared on this
interfaceSQLException
- when an exception occurs while creating the prepared statementSimpleSerializedDomainEventData
Object sql_dateTime(org.joda.time.DateTime input)
DateTime
to a data value suitable for the database scheme.input
- DateTime
to convertCopyright © 2010-2014. All Rights Reserved.