Example usage for org.springframework.data.gemfire.repository.support GemfireRepositoryFactory GemfireRepositoryFactory

List of usage examples for org.springframework.data.gemfire.repository.support GemfireRepositoryFactory GemfireRepositoryFactory

Introduction

In this page you can find the example usage for org.springframework.data.gemfire.repository.support GemfireRepositoryFactory GemfireRepositoryFactory.

Prototype

public GemfireRepositoryFactory(@NonNull Iterable<Region<?, ?>> regions,
        @NonNull MappingContext<? extends GemfirePersistentEntity<?>, GemfirePersistentProperty> mappingContext) 

Source Link

Document

Constructs a new instance of GemfireRepositoryFactory initialized with the given collection of configured Region Regions and the MappingContext .

Usage

From source file:org.spring.data.gemfire.cache.execute.ProgrammerFunctions.java

protected ProgrammerRepository getProgrammerRepository(Region<Long, Programmer> programmers) {
    if (!programmersTemplate.getRegion().equals(programmers)) {
        GemfireRepositoryFactory repositoryFactory = new GemfireRepositoryFactory(
                Collections.<Region<?, ?>>singleton(programmers), new GemfireMappingContext());

        return repositoryFactory.getRepository(ProgrammerRepository.class, new ProgrammerRepositoryImpl());
    }/*from   w  ww . j a v  a2s.  c o  m*/

    return getProgrammerRepository();
}

From source file:example.app.function.CustomerFunctions.java

protected CustomerRepository newCustomerRepository(Region<Long, Customer> customers) {
    return new GemfireRepositoryFactory(Collections.singleton(customers), mappingContext)
            .getRepository(CustomerRepository.class, null);
}