use of org.eclipse.jnosql.mapping.reactive.ReactiveRepository in project jnosql-diana by eclipse.
the class ReactiveRepositoryKeyValueBean method create.
@Override
public ReactiveRepository<?, ?> create(CreationalContext<ReactiveRepository<?, ?>> creationalContext) {
KeyValueTemplate template = provider.isEmpty() ? getInstance(KeyValueTemplate.class) : getInstance(KeyValueTemplate.class, DatabaseQualifier.ofKeyValue(provider));
ReactiveKeyValueTemplate reactiveTemplate = provider.isEmpty() ? getInstance(ReactiveKeyValueTemplate.class) : getInstance(ReactiveKeyValueTemplate.class, DatabaseQualifier.ofKeyValue(provider));
ReactiveKeyValueRepositoryProxy<?> handler = new ReactiveKeyValueRepositoryProxy<>(template, reactiveTemplate, type);
return (ReactiveRepository<?, ?>) Proxy.newProxyInstance(type.getClassLoader(), new Class[] { type }, handler);
}
use of org.eclipse.jnosql.mapping.reactive.ReactiveRepository in project jnosql-diana by eclipse.
the class ReactiveRepositoryColumnBean method create.
@Override
public ReactiveRepository<?, ?> create(CreationalContext<ReactiveRepository<?, ?>> context) {
ClassMappings classMappings = getInstance(ClassMappings.class);
ColumnTemplate template = provider.isEmpty() ? getInstance(ColumnTemplate.class) : getInstance(ColumnTemplate.class, DatabaseQualifier.ofDocument(provider));
ReactiveColumnTemplateProducer reactiveProducer = getInstance(ReactiveColumnTemplateProducer.class);
final ReactiveColumnTemplate reactiveTemplate = reactiveProducer.get(template);
Converters converters = getInstance(Converters.class);
ReactiveColumnRepositoryProxy<?> handler = new ReactiveColumnRepositoryProxy<>(reactiveTemplate, template, converters, classMappings, type);
return (ReactiveRepository<?, ?>) Proxy.newProxyInstance(type.getClassLoader(), new Class[] { type }, handler);
}
use of org.eclipse.jnosql.mapping.reactive.ReactiveRepository in project jnosql-diana by eclipse.
the class ReactiveRepositoryDocumentBean method create.
@Override
public ReactiveRepository<?, ?> create(CreationalContext<ReactiveRepository<?, ?>> context) {
ClassMappings classMappings = getInstance(ClassMappings.class);
DocumentTemplate template = provider.isEmpty() ? getInstance(DocumentTemplate.class) : getInstance(DocumentTemplate.class, DatabaseQualifier.ofDocument(provider));
ReactiveDocumentTemplateProducer reactiveProducer = getInstance(ReactiveDocumentTemplateProducer.class);
final ReactiveDocumentTemplate reactiveDocumentTemplate = reactiveProducer.get(template);
Converters converters = getInstance(Converters.class);
ReactiveDocumentRepositoryProxy<?> handler = new ReactiveDocumentRepositoryProxy<>(reactiveDocumentTemplate, template, converters, classMappings, type);
return (ReactiveRepository<?, ?>) Proxy.newProxyInstance(type.getClassLoader(), new Class[] { type }, handler);
}
Aggregations