
driven-adapter.redis-reactive.redis-template.reactive-redis-template-adapter.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scaffold-clean-architecture Show documentation
Show all versions of scaffold-clean-architecture Show documentation
Gradle plugin to create a clean application in Java that already works, It follows our best practices!
package {{package}}.redis.template;
import {{package}}.redis.template.helper.ReactiveTemplateAdapterOperations;
import org.reactivecommons.utils.ObjectMapper;
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
import org.springframework.stereotype.Component;
@Component
public class ReactiveRedisTemplateAdapter extends ReactiveTemplateAdapterOperations
// implements ModelRepository from domain
{
public ReactiveRedisTemplateAdapter(ReactiveRedisConnectionFactory connectionFactory, ObjectMapper mapper) {
/**
* Could be use mapper.mapBuilder if your domain model implement builder pattern
* super(repository, mapper, d -> mapper.mapBuilder(d,ObjectModel.ObjectModelBuilder.class).build());
* Or using mapper.map with the class of the object model
*/
super(connectionFactory, mapper, d -> mapper.map(d, Object.class/* change for domain model */));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy