Search in sources :

Example 1 with Repository

use of org.jnosql.artemis.Repository in project jnosql-artemis by eclipse.

the class RepositoryColumnBean method create.

@Override
public Repository create(CreationalContext<Repository> creationalContext) {
    ClassRepresentations classRepresentations = getInstance(ClassRepresentations.class);
    ColumnTemplate repository = provider.isEmpty() ? getInstance(ColumnTemplate.class) : getInstance(ColumnTemplate.class, provider);
    Reflections reflections = getInstance(Reflections.class);
    Converters converters = getInstance(Converters.class);
    ColumnRepositoryProxy handler = new ColumnRepositoryProxy(repository, classRepresentations, type, reflections, converters);
    return (Repository) Proxy.newProxyInstance(type.getClassLoader(), new Class[] { type }, handler);
}
Also used : Repository(org.jnosql.artemis.Repository) ColumnTemplate(org.jnosql.artemis.column.ColumnTemplate) Converters(org.jnosql.artemis.Converters) ClassRepresentations(org.jnosql.artemis.reflection.ClassRepresentations) Reflections(org.jnosql.artemis.reflection.Reflections)

Example 2 with Repository

use of org.jnosql.artemis.Repository in project jnosql-artemis by eclipse.

the class RepositoryDocumentBean method create.

@Override
public Repository create(CreationalContext<Repository> creationalContext) {
    ClassRepresentations classRepresentations = getInstance(ClassRepresentations.class);
    DocumentTemplate repository = provider.isEmpty() ? getInstance(DocumentTemplate.class) : getInstance(DocumentTemplate.class, provider);
    Reflections reflections = getInstance(Reflections.class);
    Converters converters = getInstance(Converters.class);
    DocumentRepositoryProxy handler = new DocumentRepositoryProxy(repository, classRepresentations, type, reflections, converters);
    return (Repository) Proxy.newProxyInstance(type.getClassLoader(), new Class[] { type }, handler);
}
Also used : Repository(org.jnosql.artemis.Repository) Converters(org.jnosql.artemis.Converters) DocumentTemplate(org.jnosql.artemis.document.DocumentTemplate) ClassRepresentations(org.jnosql.artemis.reflection.ClassRepresentations) Reflections(org.jnosql.artemis.reflection.Reflections)

Example 3 with Repository

use of org.jnosql.artemis.Repository in project jnosql-artemis by eclipse.

the class KeyValueRepositoryBean method create.

@Override
public Repository create(CreationalContext<Repository> creationalContext) {
    KeyValueTemplate repository = provider.isEmpty() ? getInstance(KeyValueTemplate.class) : getInstance(KeyValueTemplate.class, provider);
    KeyValueRepositoryProxy handler = new KeyValueRepositoryProxy(type, repository);
    return (Repository) Proxy.newProxyInstance(type.getClassLoader(), new Class[] { type }, handler);
}
Also used : Repository(org.jnosql.artemis.Repository) KeyValueTemplate(org.jnosql.artemis.key.KeyValueTemplate)

Aggregations

Repository (org.jnosql.artemis.Repository)3 Converters (org.jnosql.artemis.Converters)2 ClassRepresentations (org.jnosql.artemis.reflection.ClassRepresentations)2 Reflections (org.jnosql.artemis.reflection.Reflections)2 ColumnTemplate (org.jnosql.artemis.column.ColumnTemplate)1 DocumentTemplate (org.jnosql.artemis.document.DocumentTemplate)1 KeyValueTemplate (org.jnosql.artemis.key.KeyValueTemplate)1