org.axonframework.eventstore.jpa
Class AbstractEventEntryData<T>

java.lang.Object
  extended by org.axonframework.eventstore.jpa.AbstractEventEntryData<T>
Type Parameters:
T - The data type used to store the payload
All Implemented Interfaces:
SerializedDomainEventData<T>
Direct Known Subclasses:
AbstractEventEntry

@MappedSuperclass
public abstract class AbstractEventEntryData<T>
extends Object
implements SerializedDomainEventData<T>

Abstract JPA Entity, which defines all fields except for the payload and metaData field. Subclasses should declare those fields and define the format in which the data must be stored.

Since:
2.3
Author:
Allard Buijze

Nested Class Summary
static class AbstractEventEntryData.PK
          Primary key definition of the AbstractEventEntry class.
 
Constructor Summary
protected AbstractEventEntryData()
          Constructor required by JPA.
  AbstractEventEntryData(String eventIdentifier, String type, String aggregateIdentifier, long sequenceNumber, org.joda.time.DateTime timestamp, SerializedType payloadType)
          Initializes the fields in this entity using the values provided in the given parameters.
 
Method Summary
 Object getAggregateIdentifier()
          Returns the Aggregate Identifier of the associated event.
 String getEventIdentifier()
          Returns the identifier of the serialized event.
protected  SerializedType getPayloadType()
          Returns the payload type of the event message stored in this entry.
 long getSequenceNumber()
          Returns the sequence number of the associated event.
 org.joda.time.DateTime getTimestamp()
          Returns the time stamp of the associated event.
 String getType()
          Returns the type identifier of the aggregate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.axonframework.serializer.SerializedDomainEventData
getMetaData, getPayload
 

Constructor Detail

AbstractEventEntryData

public AbstractEventEntryData(String eventIdentifier,
                              String type,
                              String aggregateIdentifier,
                              long sequenceNumber,
                              org.joda.time.DateTime timestamp,
                              SerializedType payloadType)
Initializes the fields in this entity using the values provided in the given parameters.

Parameters:
eventIdentifier - The identifier of the event.
type - The type identifier of the aggregate that published the event
aggregateIdentifier - The identifier of the aggregate that published the event
sequenceNumber - The sequence number of the event
timestamp - The timestamp of the creation of the event
payloadType - The type of payload contained in the event

AbstractEventEntryData

protected AbstractEventEntryData()
Constructor required by JPA.

Method Detail

getEventIdentifier

public String getEventIdentifier()
Description copied from interface: SerializedDomainEventData
Returns the identifier of the serialized event.

Specified by:
getEventIdentifier in interface SerializedDomainEventData<T>
Returns:
the identifier of the serialized event

getAggregateIdentifier

public Object getAggregateIdentifier()
Returns the Aggregate Identifier of the associated event.

Specified by:
getAggregateIdentifier in interface SerializedDomainEventData<T>
Returns:
the Aggregate Identifier of the associated event.

getType

public String getType()
Returns the type identifier of the aggregate.

Returns:
the type identifier of the aggregate.

getSequenceNumber

public long getSequenceNumber()
Returns the sequence number of the associated event.

Specified by:
getSequenceNumber in interface SerializedDomainEventData<T>
Returns:
the sequence number of the associated event.

getTimestamp

public org.joda.time.DateTime getTimestamp()
Returns the time stamp of the associated event.

Specified by:
getTimestamp in interface SerializedDomainEventData<T>
Returns:
the time stamp of the associated event.

getPayloadType

protected SerializedType getPayloadType()
Returns the payload type of the event message stored in this entry.

Returns:
the payload type of the event message stored in this entry


Copyright © 2010-2016. All Rights Reserved.