Search in sources :

Example 1 with ReactiveRepository

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);
}
Also used : ReactiveKeyValueTemplate(org.eclipse.jnosql.mapping.keyvalue.reactive.ReactiveKeyValueTemplate) ReactiveRepository(org.eclipse.jnosql.mapping.reactive.ReactiveRepository) ReactiveKeyValueTemplate(org.eclipse.jnosql.mapping.keyvalue.reactive.ReactiveKeyValueTemplate) KeyValueTemplate(jakarta.nosql.mapping.keyvalue.KeyValueTemplate)

Example 2 with ReactiveRepository

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);
}
Also used : ReactiveRepository(org.eclipse.jnosql.mapping.reactive.ReactiveRepository) ReactiveColumnTemplate(org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplate) ColumnTemplate(jakarta.nosql.mapping.column.ColumnTemplate) ReactiveColumnTemplate(org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplate) ReactiveColumnTemplateProducer(org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplateProducer) Converters(jakarta.nosql.mapping.Converters) ClassMappings(org.eclipse.jnosql.mapping.reflection.ClassMappings)

Example 3 with ReactiveRepository

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);
}
Also used : ReactiveRepository(org.eclipse.jnosql.mapping.reactive.ReactiveRepository) ReactiveDocumentTemplate(org.eclipse.jnosql.mapping.document.reactive.ReactiveDocumentTemplate) Converters(jakarta.nosql.mapping.Converters) ReactiveDocumentTemplate(org.eclipse.jnosql.mapping.document.reactive.ReactiveDocumentTemplate) DocumentTemplate(jakarta.nosql.mapping.document.DocumentTemplate) ReactiveDocumentTemplateProducer(org.eclipse.jnosql.mapping.document.reactive.ReactiveDocumentTemplateProducer) ClassMappings(org.eclipse.jnosql.mapping.reflection.ClassMappings)

Aggregations

ReactiveRepository (org.eclipse.jnosql.mapping.reactive.ReactiveRepository)3 Converters (jakarta.nosql.mapping.Converters)2 ClassMappings (org.eclipse.jnosql.mapping.reflection.ClassMappings)2 ColumnTemplate (jakarta.nosql.mapping.column.ColumnTemplate)1 DocumentTemplate (jakarta.nosql.mapping.document.DocumentTemplate)1 KeyValueTemplate (jakarta.nosql.mapping.keyvalue.KeyValueTemplate)1 ReactiveColumnTemplate (org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplate)1 ReactiveColumnTemplateProducer (org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplateProducer)1 ReactiveDocumentTemplate (org.eclipse.jnosql.mapping.document.reactive.ReactiveDocumentTemplate)1 ReactiveDocumentTemplateProducer (org.eclipse.jnosql.mapping.document.reactive.ReactiveDocumentTemplateProducer)1 ReactiveKeyValueTemplate (org.eclipse.jnosql.mapping.keyvalue.reactive.ReactiveKeyValueTemplate)1