templates.internal_data_access.st Maven / Gradle / Ivy
package ;
import java.util.List;
import poussecafe.discovery.DataAccessImplementation;
import poussecafe.storage.internal.InternalDataAccess;
import poussecafe.storage.internal.InternalStorage;
import .;
import .Id;
import .DataAccess;
import static java.util.stream.Collectors.toList;
@DataAccessImplementation(
aggregateRoot = .class,
dataImplementation = Attributes.class,
storageName = InternalStorage.NAME
)
public class InternalDataAccess extends InternalDataAccess\<Id, Attributes> implements DataAccess\<Attributes> {
public InternalDataAccess() {
versionField("version");
}
@Override
public List\<Attributes> findByName(String name) {
return findAll().stream()
.filter(data -> data.name().valueEquals(name))
.collect(toList());
}
}