Search in sources :

Example 1 with ReactiveColumnTemplateProducer

use of org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplateProducer in project jnosql-diana by eclipse.

the class ReactiveColumnManagerConverter method success.

@Override
protected ReactiveColumnTemplate success(String value) {
    Config config = BeanManagers.getInstance(Config.class);
    final ColumnTemplate template = config.getValue(value, ColumnTemplate.class);
    ReactiveColumnTemplateProducer producer = BeanManagers.getInstance(ReactiveColumnTemplateProducer.class);
    return producer.get(template);
}
Also used : ReactiveColumnTemplate(org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplate) ColumnTemplate(jakarta.nosql.mapping.column.ColumnTemplate) Config(org.eclipse.microprofile.config.Config) ReactiveColumnTemplateProducer(org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplateProducer)

Example 2 with ReactiveColumnTemplateProducer

use of org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplateProducer 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)

Aggregations

ColumnTemplate (jakarta.nosql.mapping.column.ColumnTemplate)2 ReactiveColumnTemplate (org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplate)2 ReactiveColumnTemplateProducer (org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplateProducer)2 Converters (jakarta.nosql.mapping.Converters)1 ReactiveRepository (org.eclipse.jnosql.mapping.reactive.ReactiveRepository)1 ClassMappings (org.eclipse.jnosql.mapping.reflection.ClassMappings)1 Config (org.eclipse.microprofile.config.Config)1