package com.github.eventasia.dynamodb;

import com.github.eventasia.framework.Aggregate;
import org.springframework.stereotype.Component;

import java.util.UUID;

@Component
public class EventasiaDynamoDBAggregateRepositoryImpl<A extends Aggregate> implements EventasiaDynamoDBAggregateRepository<A> {

    private final EventasiaDynamoDBConfig config;
    private final Class clazz;

    public EventasiaDynamoDBAggregateRepositoryImpl(EventasiaDynamoDBConfig config, Class clazz) {
        this.config = config;
        this.clazz = clazz;
    }

    @Override
    public void save(A aggregate) {
        config.getMapper().save(aggregate);
    }

    @Override
    public A get(UUID uuid) {
        return (A) config.getMapper().load(clazz, uuid);
    }
}

@@ -85,57 +85,8 @@
 ate;
-%0Aimport org.springframework.stereotype.Component;
 %0A%0Aim
@@ -111,19 +111,8 @@
 D;%0A%0A
-@Component%0A
 publ

remove component annotation from dynamo repo