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
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