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 Hibernate/JPA Dealing with entities with the same name in different persistence units Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate/JPA Dealing with entities with the same name in different persistence units" Watch "Hibernate/JPA Dealing with entities with the same name in different persistence units" New topic
Author

Hibernate/JPA Dealing with entities with the same name in different persistence units

John Ament
Greenhorn

Joined: Jul 07, 2007
Posts: 22
When I looked at how they setup the databases, I didn't think it would be an issue, but apparently it is.

Basically, we have schemas in multiple database that match almost exactly. For the sake of what I'm doing, all affected entities are the same in all 8 schemas. My application runs on jboss 5.1 and uses the latest hibernate on there (I assume a 3.2 release). All of the databases are oracle. When I run a query for one of these objects, I get no results, even though there are results. I refactored my code to use a PK find in the EM, and the result was the below stack trace:



The way my code works is that for each of these 8 schemas, there's a different persistence unit. My understanding was that the mapping was local to the persistence unit (similar to the hibernate mappings and each individual session factory). Was I wrong on this one?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate/JPA Dealing with entities with the same name in different persistence units
 
Similar Threads
conflict Jboss+WebLogic web service
The Perennial Lazy loading dilemma from the heart of a novice
Axis Error java.lang.NoClassDefFoundError: org/apache/commons/discovery/tools/DiscoverSingleton
Error while calling webservice client from EJB3 SLB Local interface.
javax.naming.NotContextException