com.github.eventasia.cassandra.EventasiaCassandraAggregateRepositoryImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of store-cassandra Show documentation
Show all versions of store-cassandra Show documentation
Eventasia is a Event Sourcing Framework for use with Spring Boot
package com.github.eventasia.cassandra;
import com.github.eventasia.eventstore.repository.ReadWriteAggregateRepository;
import com.github.eventasia.framework.Aggregate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.UUID;
@Component
public class EventasiaCassandraAggregateRepositoryImpl implements ReadWriteAggregateRepository {
@Autowired
CassandraConfig cassandraConfig;
@Override
public A get(UUID uuid) {
return (A) cassandraConfig.getManager().mapper(Aggregate.class).get();
}
@Override
public void save(A aggregate) {
cassandraConfig.getManager().mapper(Aggregate.class).save(aggregate);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy