Example usage for org.springframework.orm.jpa JpaTransactionManager getEntityManagerFactory

List of usage examples for org.springframework.orm.jpa JpaTransactionManager getEntityManagerFactory

Introduction

In this page you can find the example usage for org.springframework.orm.jpa JpaTransactionManager getEntityManagerFactory.

Prototype

@Nullable
public EntityManagerFactory getEntityManagerFactory() 

Source Link

Document

Return the EntityManagerFactory that this instance should manage transactions for.

Usage

From source file:org.lightmare.jpa.spring.SpringORM.java

/**
 * Initializes and builds {@link EntityManagerFactory} from configuration
 * /*  w  w w  . j  a  v  a2s.co m*/
 * @return {@link EntityManagerFactory}
 * @throws IOException
 */
public EntityManagerFactory getEmf() throws IOException {

    EntityManagerFactory emf;

    initProperties();
    initDataSource();
    JpaTransactionManager transactionManager = transactionManager();
    emf = transactionManager.getEntityManagerFactory();

    return emf;
}