All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.eventasia.cassandra.EventasiaCassandraAggregateRepositoryImpl Maven / Gradle / Ivy

There is a newer version: 0.0.5.RELEASE
Show newest version
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