Forums Register Login

EntityManager

+Pie Number of slices to send: Send
Hi all ,
iam trying to get instance of EntityManagerFactory by using Persistence.createEntityManagerFactory and providing the Persistence unit on Persistence.xml , but my problem is strange , if i moved out the process of createEntityManagerFactory to another class with a static method and trying to do like this :

EntityManagerFactory x = class.method "which returns "EntityManagerFactory" it gives me NullPointerException , but if i assigned it directly :

EntityManagerFactory x = Persistence.createEntityManagerFactory it works

Does any one can explain this to me !!! iam using JDeveloper by the way
+Pie Number of slices to send: Send
Can you kindly post your code? Thanks.
The City calls upon her steadfast protectors. Now for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 482 times.
Similar Threads
static methods in Servlet
not able to insert data in db using jpa(hibernate as provider) and jboss AS
Persistence Question
problem in pro EJB3 chapter 2 code
JPA Newbie Question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 22:55:39.