com.github.rahulsom.grooves.queries.VersionedJoinSupport Maven / Gradle / Ivy
package com.github.rahulsom.grooves.queries;
import com.github.rahulsom.grooves.api.AggregateType;
import com.github.rahulsom.grooves.api.events.BaseEvent;
import com.github.rahulsom.grooves.api.events.DisjoinEvent;
import com.github.rahulsom.grooves.api.events.JoinEvent;
import com.github.rahulsom.grooves.api.snapshots.VersionedJoin;
import com.github.rahulsom.grooves.queries.internal.BaseQuery;
import com.github.rahulsom.grooves.queries.internal.Executor;
import com.github.rahulsom.grooves.queries.internal.JoinExecutor;
/**
* Default interface that makes versioned joins easier to write.
*
* @param The Aggregate this join represents
* @param The type for the {@link EventT}'s id field
* @param The base type for events that apply to {@link AggregateT}
* @param The type for the join's id field
* @param The type for the other id of aggregate that {@link AggregateT} joins
* to
* @param The type for the other aggregate that {@link AggregateT} joins to
* @param The type of Snapshot that is computed
* @param The type of the Join Event
* @param The type of the disjoin event
*
* @author Rahul Somasunderam
*/
public interface VersionedJoinSupport<
AggregateIdT,
AggregateT extends AggregateType,
EventIdT,
EventT extends BaseEvent,
JoinedAggregateIdT,
JoinedAggregateT extends AggregateType,
SnapshotIdT,
SnapshotT extends VersionedJoin,
JoinEventT extends JoinEvent,
DisjoinEventT extends DisjoinEvent,
QueryT extends BaseQuery
> extends
VersionedQuerySupport {
Class getJoinEventClass();
Class getDisjoinEventClass();
@Override
default Executor getExecutor() {
return new JoinExecutor<>(getJoinEventClass(), getDisjoinEventClass());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy