Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EntityManager  RSS feed

 
Mohammad Jaber
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Reza Rahman
author
Ranch Hand
Posts: 580
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you kindly post your code? Thanks.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!