I just begin my JPA 2.0 studies, and I have this piece of code:
em = SessionFactory.startSession(); tx = em.getTransaction();
My problem is
em = SessionFactory.startSession();
In JPA, there is no Session and no SessionFactory. SessionFactory is a hibernate-specific interface that you shouldn't use if you use JPA (use either Hibernate's own API or use Hibernate as JPA Provider, but not both.)