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);
}
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);
}
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);
}
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);
}
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");
}
Aggregations