How to share EntityManagerFactory Object across the various Resource files in a Restlet application?

StackOverflow https://stackoverflow.com/questions/2340344

문제

I would like to create one EMF object and use it in various Resource class objects.. any ideas on how to do this?

도움이 되었습니까?

해결책

the answer is to use a class which follows the singleton design pattern - for more details see - http://vatsalad.wordpress.com/2010/03/05/single-entitymanagerfactory-object-across-various-restlet-resources/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top