@Test @DisplayName("update entity via a custom migration") void performCustomMigration() { ProjectId id = createId(42); TestProjectionRepository repository = repository(); TestProjection projection = new TestProjection(id); repository.store(projection); TargetFilters targetFilters = targetFilters(Project.Column.idString(), id.toString()); Iterator<TestProjection> found = repository.find(targetFilters, ResponseFormat.getDefaultInstance()); assertThat(found.hasNext()).isFalse(); repository.applyMigration(id, new SetTestProjectionId()); Iterator<TestProjection> afterMigration = repository.find(targetFilters, ResponseFormat.getDefaultInstance()); assertThat(afterMigration.hasNext()).isTrue(); TestProjection entityWithColumns = afterMigration.next(); Project expectedState = projection .state() .toBuilder() .setIdString(projection.getIdString()) .build(); assertThat(entityWithColumns.state()).isEqualTo(expectedState); }
@Override public final void store(P entity) { cache.store(entity); }
ProjectionRepository extends EventDispatchingRepository<I, P, S> { @Override public final void store(P entity) { cache.store(entity); } }
ProjectionRepository extends EventDispatchingRepository<I, P, S> { @Override public final void store(P entity) { cache.store(entity); }  }
ProjectionRepository extends EventDispatchingRepository<I, P, S> { @Override public final void store(P entity) { cache.store(entity); }  @Override @OverridingMethodsMustInvokeSuper void registerWith(BoundedContext context); @OverridingMethodsMustInvokeSuper @Override P create(I id); @Override final void store(P entity); @Override final ImmutableSet<EventClass> messageClasses(); @Override final ImmutableSet<EventClass> domesticEventClasses(); @Override final ImmutableSet<EventClass> externalEventClasses(); @OverridingMethodsMustInvokeSuper @Override final boolean canDispatch(EventEnvelope event); CatchUpId catchUp(Timestamp since, @Nullable Set<I> ids); CatchUpId catchUpAll(Timestamp since); @OverridingMethodsMustInvokeSuper @Override void close(); }
ProjectionRepository extends EventDispatchingRepository<I, P, S> { @Override public final void store(P entity) { cache.store(entity); }  @Override @OverridingMethodsMustInvokeSuper void registerWith(BoundedContext context); @OverridingMethodsMustInvokeSuper @Override P create(I id); @Override final void store(P entity); @Override final ImmutableSet<EventClass> messageClasses(); @Override final ImmutableSet<EventClass> domesticEventClasses(); @Override final ImmutableSet<EventClass> externalEventClasses(); @OverridingMethodsMustInvokeSuper @Override final boolean canDispatch(EventEnvelope event); CatchUpId catchUp(Timestamp since, @Nullable Set<I> ids); CatchUpId catchUpAll(Timestamp since); @OverridingMethodsMustInvokeSuper @Override void close();  }