@Accessors(fluent = true) public class BogusEvent extends StandardEvent { @Getter private final String string; @Index({EQ, SC}) public final static SimpleIndex<BogusEvent, String> ATTR = SimpleIndex.as(BogusEvent::string); @Builder public BogusEvent(HybridTimestamp timestamp, String string) { super(timestamp); this.string = string == null ? "bogus" : string; } }
IndexEngine.IndexFeature[] features = annotation == null ? new IndexEngine.IndexFeature[]{EQ} : annotation.value(); EntityIndex index = ((EntityIndex) field.get(null)); ParameterizedType type = (ParameterizedType) field.getGenericType();
/** * This event signifies deletion of a referenced instance. */ @Accessors(fluent = true) @Draft @RFC(url = "http://rfc.eventsourcing.com/spec:3/CEP") @LayoutName("rfc.eventsourcing.com/spec:3/CEP/#Deleted") public class Deleted extends StandardEvent { @Getter final UUID reference; @Index public final static SimpleIndex<Deleted, UUID> ID = SimpleIndex.as(StandardEntity::uuid); public final static SimpleIndex<Deleted, UUID> REFERENCE_ID = SimpleIndex.as(Deleted::reference); @Index({EQ, LT, GT}) public final static SimpleIndex<Deleted, HybridTimestamp> TIMESTAMP = SimpleIndex.as(StandardEntity::timestamp); @LayoutConstructor public Deleted(UUID reference) { this.reference = reference; } @Builder public Deleted(UUID reference, HybridTimestamp timestamp) { super(timestamp); this.reference = reference; } }
@Value @EqualsAndHashCode(callSuper = false) @Accessors(fluent = true) public static class TestEvent extends StandardEvent { String prop; public final static SimpleIndex<TestEvent, String> PROP = SimpleIndex.as(TestEvent::prop); @Index({EQ, LT, GT}) public final static SimpleIndex<TestEvent, HybridTimestamp> TIMESTAMP = SimpleIndex.as( StandardEntity::timestamp); }
@Value @EqualsAndHashCode(callSuper = false) @Accessors(fluent = true) public static class TestEvent extends StandardEvent { private String test; private UUID reference; public final static SimpleIndex<TestEvent, UUID> REFERENCE_ID = SimpleIndex.as(TestEvent::reference); @Index({EQ, LT, GT}) public final static SimpleIndex<TestEvent, HybridTimestamp> TIMESTAMP = SimpleIndex.as(StandardEntity::timestamp); }
@Value @EqualsAndHashCode(callSuper = false) @Accessors(fluent = true) public static class TestEvent extends StandardEvent { String prop; public final static SimpleIndex<TestEvent, String> PROP = SimpleIndex.as(TestEvent::prop); @Index({EQ, LT, GT}) public final static SimpleIndex<TestEvent, HybridTimestamp> TIMESTAMP = SimpleIndex.as(StandardEntity::timestamp); }
/** * This event signifies deletion of a referenced instance. */ @Accessors(fluent = true) @Draft @RFC(url = "http://rfc.eventsourcing.com/spec:3/CEP") @LayoutName("rfc.eventsourcing.com/spec:3/CEP/#Deleted") public class Deleted extends StandardEvent { @Getter final UUID reference; @Index public final static SimpleIndex<Deleted, UUID> ID = SimpleIndex.as(StandardEntity::uuid); public final static SimpleIndex<Deleted, UUID> REFERENCE_ID = SimpleIndex.as(Deleted::reference); @Index({EQ, LT, GT}) public final static SimpleIndex<Deleted, HybridTimestamp> TIMESTAMP = SimpleIndex.as(StandardEntity::timestamp); @LayoutConstructor public Deleted(UUID reference) { this.reference = reference; } @Builder public Deleted(UUID reference, HybridTimestamp timestamp) { super(timestamp); this.reference = reference; } }
@Index({LT, GT, EQ}) public final static SimpleIndex<DescriptionChanged, HybridTimestamp> TIMESTAMP = SimpleIndex.as(StandardEntity::timestamp);
@Index({LT, GT, EQ}) public final static SimpleIndex<NameChanged, HybridTimestamp> TIMESTAMP = SimpleIndex.as(StandardEntity::timestamp);
@Accessors(fluent = true) @LayoutName("rfc.eventsourcing.com/spec:8/EMT/#EntityLayoutIntroduced") @Raw @RFC(url = "http://rfc.eventsourcing.com/spec:8/EMT/", revision = "July 22, 2016") public class EntityLayoutIntroduced extends StandardEvent { @Getter private final byte[] fingerprint; @Getter private final Optional<Layout<?>> layout; @Builder public EntityLayoutIntroduced(HybridTimestamp timestamp, byte[] fingerprint, Optional<Layout<?>> layout) { super(timestamp); this.fingerprint = fingerprint; this.layout = layout; } public EntityLayoutIntroduced(byte[] fingerprint, Optional<Layout<?>> layout) { this(null, fingerprint, layout); } @Index({EQ, UNIQUE}) public final static SimpleIndex<EntityLayoutIntroduced, byte[]> FINGERPRINT = SimpleIndex.as(EntityLayoutIntroduced::fingerprint); }
/** * This event signifies undeletion of a referenced deletion. */ @Accessors(fluent = true) @Draft @RFC(url = "http://rfc.eventsourcing.com/spec:3/CEP") @LayoutName("rfc.eventsourcing.com/spec:3/CEP/#Undeleted") public class Undeleted extends StandardEvent { @Getter final UUID deleted; public final static SimpleIndex<Undeleted, UUID> DELETED_ID = SimpleIndex.as(Undeleted::deleted); @Index({EQ, LT, GT}) public final static SimpleIndex<Undeleted, HybridTimestamp> TIMESTAMP = SimpleIndex.as(StandardEntity::timestamp); @LayoutConstructor public Undeleted(UUID deleted) { this.deleted = deleted; } @Builder public Undeleted(UUID deleted, HybridTimestamp timestamp) { super(timestamp); this.deleted = deleted; } }
@Index({LT, GT, EQ}) public final static SimpleIndex<DescriptionChanged, HybridTimestamp> TIMESTAMP = SimpleIndex.as(StandardEntity::timestamp);
/** * This event signifies undeletion of a referenced deletion. */ @Accessors(fluent = true) @Draft @RFC(url = "http://rfc.eventsourcing.com/spec:3/CEP") @LayoutName("rfc.eventsourcing.com/spec:3/CEP/#Undeleted") public class Undeleted extends StandardEvent { @Getter final UUID deleted; public final static SimpleIndex<Undeleted, UUID> DELETED_ID = SimpleIndex.as(Undeleted::deleted); @Index({EQ, LT, GT}) public final static SimpleIndex<Undeleted, HybridTimestamp> TIMESTAMP = SimpleIndex.as(StandardEntity::timestamp); @LayoutConstructor public Undeleted(UUID deleted) { this.deleted = deleted; } @Builder public Undeleted(UUID deleted, HybridTimestamp timestamp) { super(timestamp); this.deleted = deleted; } }
@Index({LT, GT, EQ}) public final static SimpleIndex<NameChanged, HybridTimestamp> TIMESTAMP = SimpleIndex.as(StandardEntity::timestamp);