Does the EntityManager work normally, for example does em.persist() work ?
I have had a problem berfore with em.getDelegate() returning an EntityManagerImpl which could not be cast to a session.
In the end i had to call
Session sess = (Session)((EntityManagerImpl)em.getDelegate()).getDelegate()
Session sess = (Session)((EntityManagerImpl)em.getDelegate()).getSession()
Yes, entityManager works fine with method persist.Only I can't get
Session from entityM.
I'm going to try.
Ok, I solved a problem.Now I have another:(.Problem is :It doesn't retrieves expected result(it 's retrieve nothing). Is there any mistake in my code above?