File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes How can I use Hibernate as JPA implementation without hardcoding datasource in persistence.xml ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How can I use Hibernate as JPA implementation without hardcoding datasource in persistence.xml ?" Watch "How can I use Hibernate as JPA implementation without hardcoding datasource in persistence.xml ?" New topic
Author

How can I use Hibernate as JPA implementation without hardcoding datasource in persistence.xml ?

Boris Romashov
Ranch Hand

Joined: Feb 23, 2009
Posts: 38
As Glassfish has built-in Toplink JPA I need to explicitly define to use Hibernate as JPA implementation.
So I need to specify provider in persistence.xml.
When I did it, I need also specify jta-data-source and hibernate.transaction.manager_lookup_class.
After that I cannot write unit test because in unit-test I don't have any jndi resource.
How can I make it ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I use Hibernate as JPA implementation without hardcoding datasource in persistence.xml ?
 
Similar Threads
One To One Mapping not working, plz help me out
Strange Persistence Unit deployment error in JBoss 6
Adding persistence.xml dynamically
validate or look if "Bean-Managed-Transaction" or "Container-Managed-Transaction"
confused with JAP,Hibernate