Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package rzd.vivc.documentexamination.configuration; import rzd.vivc.documentexamination.repository.*; import javax.inject.Inject; import javax.persistence.EntityManagerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; /** * ?? ? ? * * @author VVolgina */ @Configuration @EnableTransactionManagement public class TransactionsConfig { @Autowired private EntityManagerFactory emf; /** *?? ? ? * @return */ @Bean public PlatformTransactionManager transactionManager() { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(emf); return transactionManager; } }