Thx ;)
On Thursday, October 18, 2012 9:18:52 AM UTC+2, Laurent Opprecht wrote:
I finally got Eclipse to work with my junit test and JPA - i.e. Hibernate. I did the following- Add the conf folder as source folder - in order to capture persistence xml - right click project -> properties -> Java Build Path -> add folder
- Unchecked Build > Build automaticaly
- Added ALL my entity models to persistence.xml
- <class>models.User</class>
- ...
- Compiled everything
- Added a fake application with entity manager attached to the thread:
app = Helpers.fakeApplication();
JPA.bindForCurrentThread(em);
em.getTransaction().begin();
Note that eclipsify do not add conf as a source folder. As a consequence it is likely that re-running eclipsify will erase the above configuration.
Hope this will benefit others.