Example usage for org.springframework.data.repository.core.support RepositoryFactorySupport getRepository

List of usage examples for org.springframework.data.repository.core.support RepositoryFactorySupport getRepository

Introduction

In this page you can find the example usage for org.springframework.data.repository.core.support RepositoryFactorySupport getRepository.

Prototype

public <T> T getRepository(Class<T> repositoryInterface) 

Source Link

Document

Returns a repository instance for the given interface.

Usage

From source file:ejb.HelloEjb.java

@javax.annotation.PostConstruct
public void init() {
    RepositoryFactorySupport factory = new JpaRepositoryFactory(em);
    this.repository = factory.getRepository(AccountRepository.class);
}

From source file:ogm.test.MultipleRelationshipsToSameEntityType.java

@Before
public void setUp() {
    RepositoryFactorySupport factory = new GraphRepositoryFactory(
            new SessionFactory("ogm.test.domain").openSession(getNeo4jDatabaseUrl()));
    // create repositories programmatically
    ownedLicensedEntityRepository = factory.getRepository(OwnedLicensedEntityRepository.class);
    userRepository = factory.getRepository(UserRepository.class);

    // clear the database
    initGraph();/*from ww w . j a v  a2s  . com*/

    // set up the nodes and relationships for the test
    executeCypher(getCypherTransactionImmediateCommitUrl(), getSetUpCypher());
}