Search in sources :

Example 6 with ColumnTemplate

use of jakarta.nosql.mapping.column.ColumnTemplate in project jnosql-diana by eclipse.

the class DefaultReactiveColumnTemplateProducerTest method shouldReturnTemplate.

@Test
public void shouldReturnTemplate() {
    final ColumnTemplate template = Mockito.mock(ColumnTemplate.class);
    final ReactiveColumnTemplate reactiveTemplate = producer.get(template);
    assertNotNull(reactiveTemplate);
}
Also used : ColumnTemplate(jakarta.nosql.mapping.column.ColumnTemplate) Test(org.junit.jupiter.api.Test)

Example 7 with ColumnTemplate

use of jakarta.nosql.mapping.column.ColumnTemplate 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 8 with ColumnTemplate

use of jakarta.nosql.mapping.column.ColumnTemplate in project jnosql-diana by eclipse.

the class DefaultColumnTemplateProducerTest method shouldReturn.

@Test
public void shouldReturn() {
    ColumnFamilyManager manager = Mockito.mock(ColumnFamilyManager.class);
    ColumnTemplate columnTemplate = producer.get(manager);
    assertNotNull(columnTemplate);
}
Also used : ColumnFamilyManager(jakarta.nosql.column.ColumnFamilyManager) ColumnTemplate(jakarta.nosql.mapping.column.ColumnTemplate) Test(org.junit.jupiter.api.Test)

Example 9 with ColumnTemplate

use of jakarta.nosql.mapping.column.ColumnTemplate 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 10 with ColumnTemplate

use of jakarta.nosql.mapping.column.ColumnTemplate in project jnosql-diana by eclipse.

the class ColumnTemplateConverterTest method shouldReturnTemplate.

@Test
public void shouldReturnTemplate() {
    final String prefix = UUID.randomUUID().toString();
    System.setProperty(prefix, prefix);
    System.setProperty(prefix + ".settings.key", "value");
    System.setProperty(prefix + ".settings.key2", "value2");
    System.setProperty(prefix + ".provider", ColumnConfigurationMock.class.getName());
    System.setProperty(prefix + ".database", "database");
    final ColumnTemplate template = config.getValue(prefix, ColumnTemplate.class);
    Assertions.assertNotNull(template);
    System.clearProperty(prefix);
    System.clearProperty(prefix + ".settings.key");
    System.clearProperty(prefix + ".settings.key2");
    System.clearProperty(prefix + ".provider");
    System.clearProperty(prefix + ".database");
}
Also used : ColumnTemplate(jakarta.nosql.mapping.column.ColumnTemplate) Test(org.junit.jupiter.api.Test)

Aggregations

ColumnTemplate (jakarta.nosql.mapping.column.ColumnTemplate)14 Test (org.junit.jupiter.api.Test)10 Person (jakarta.nosql.tck.entities.Person)6 ColumnQuery (jakarta.nosql.column.ColumnQuery)5 Pagination (jakarta.nosql.mapping.Pagination)3 ColumnQueryPagination (jakarta.nosql.mapping.column.ColumnQueryPagination)3 Converters (jakarta.nosql.mapping.Converters)2 ReactiveColumnTemplate (org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplate)2 ReactiveColumnTemplateProducer (org.eclipse.jnosql.mapping.column.reactive.ReactiveColumnTemplateProducer)2 ClassMappings (org.eclipse.jnosql.mapping.reflection.ClassMappings)2 ColumnDeleteQuery (jakarta.nosql.column.ColumnDeleteQuery)1 ColumnFamilyManager (jakarta.nosql.column.ColumnFamilyManager)1 Repository (jakarta.nosql.mapping.Repository)1 PersonRepository (jakarta.nosql.tck.entities.PersonRepository)1 ReactiveRepository (org.eclipse.jnosql.mapping.reactive.ReactiveRepository)1 Config (org.eclipse.microprofile.config.Config)1