Last active
March 26, 2016 14:50
-
-
Save Tcharl/85c5c141dc8581242794 to your computer and use it in GitHub Desktop.
Simple repository implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @OsgiServiceProvider(classes = { HelloRepository.class }) | |
| @Singleton | |
| @Transactional | |
| public class HelloJpaRepository extends DelegatingSimpleJpaRepository<HelloEntity, Long> implements HelloRepository { | |
| /** | |
| * Entity manager. | |
| */ | |
| @PersistenceContext(unitName = "myTestPu") | |
| private EntityManager em; | |
| @PersistenceUnit( unitName = "myTestPu") | |
| private EntityManagerFactory emf; | |
| @Override | |
| @PostConstruct | |
| public void postConstruct() { | |
| instanciateDelegateRepository(emf, em, HelloEntity.class); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment