Search in sources :

Example 6 with KeyValueTemplate

use of jakarta.nosql.mapping.keyvalue.KeyValueTemplate in project jnosql-diana by eclipse.

the class DefaultKeyValueRepositoryProducerTest method shouldCreateFromTemplate.

@Test
public void shouldCreateFromTemplate() {
    KeyValueTemplate template = Mockito.mock(KeyValueTemplate.class);
    PersonRepository personRepository = producer.get(PersonRepository.class, template);
    assertNotNull(personRepository);
}
Also used : PersonRepository(jakarta.nosql.tck.entities.PersonRepository) KeyValueTemplate(jakarta.nosql.mapping.keyvalue.KeyValueTemplate) Test(org.junit.jupiter.api.Test)

Example 7 with KeyValueTemplate

use of jakarta.nosql.mapping.keyvalue.KeyValueTemplate in project jnosql-diana by eclipse.

the class DefaultKeyValueRepositoryProducer method get.

@Override
public <T, K, R extends Repository<T, K>> R get(Class<R> repositoryClass, BucketManager manager) {
    Objects.requireNonNull(repositoryClass, "repository class is required");
    Objects.requireNonNull(manager, "manager class is required");
    KeyValueTemplate template = producer.get(manager);
    return get(repositoryClass, template);
}
Also used : KeyValueTemplate(jakarta.nosql.mapping.keyvalue.KeyValueTemplate)

Example 8 with KeyValueTemplate

use of jakarta.nosql.mapping.keyvalue.KeyValueTemplate in project jnosql-diana by eclipse.

the class ReactiveKeyValueManagerConverter method success.

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

Example 9 with KeyValueTemplate

use of jakarta.nosql.mapping.keyvalue.KeyValueTemplate in project jnosql-diana by eclipse.

the class ReactiveTemplateBean method create.

@Override
public ReactiveKeyValueTemplate create(CreationalContext<ReactiveKeyValueTemplate> creationalContext) {
    ReactiveKeyValueTemplateProducer producer = getInstance(ReactiveKeyValueTemplateProducer.class);
    KeyValueTemplate template = getManager();
    return producer.get(template);
}
Also used : ReactiveKeyValueTemplate(org.eclipse.jnosql.mapping.keyvalue.reactive.ReactiveKeyValueTemplate) KeyValueTemplate(jakarta.nosql.mapping.keyvalue.KeyValueTemplate) ReactiveKeyValueTemplateProducer(org.eclipse.jnosql.mapping.keyvalue.reactive.ReactiveKeyValueTemplateProducer)

Example 10 with KeyValueTemplate

use of jakarta.nosql.mapping.keyvalue.KeyValueTemplate in project jnosql-diana by eclipse.

the class ReactiveKeyValueRepositoryProducerTest method shouldCreateFromTemplate.

@Test
public void shouldCreateFromTemplate() {
    KeyValueTemplate template = Mockito.mock(KeyValueTemplate.class);
    PersonRepository personRepository = producer.get(PersonRepository.class, template);
    assertNotNull(personRepository);
}
Also used : KeyValueTemplate(jakarta.nosql.mapping.keyvalue.KeyValueTemplate) Test(org.junit.jupiter.api.Test)

Aggregations

KeyValueTemplate (jakarta.nosql.mapping.keyvalue.KeyValueTemplate)10 Test (org.junit.jupiter.api.Test)5 ReactiveKeyValueTemplate (org.eclipse.jnosql.mapping.keyvalue.reactive.ReactiveKeyValueTemplate)3 ReactiveKeyValueTemplateProducer (org.eclipse.jnosql.mapping.keyvalue.reactive.ReactiveKeyValueTemplateProducer)2 BucketManager (jakarta.nosql.keyvalue.BucketManager)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