aspose file tools*
The moose likes Object Relational Mapping and the fly likes Complicated mapping problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Complicated mapping problem" Watch "Complicated mapping problem" New topic
Author

Complicated mapping problem

Joris Vleminckx
Greenhorn

Joined: Sep 07, 2007
Posts: 1
Hello,

I have a complicated mapping problem:
Consider the following db schema:

I need to map this to the following beans, and unfortunately I can't change nor the bean structure neither the db schema.



So far I have tried the following mappings:



This doesn't work: "collection foreign key mapping has wrong number of columns", due to the non-declaration of the composite primary key in EOUser (which I can't declare there, because I can only have 'eoUserId' in the EOUser bean). I know the db schema is sh*t (no direct PK's, only foreign keys which form a PK), but I'd like to know if it is possible to map this with Hibernate.
Thanks in advance.

Joris
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Complicated mapping problem
 
Similar Threads
Many-to-one mapping issue
joins in Hibernate Annotation
Hibernate- one-to-many association on a foreign key
Persisting one-to-many object using sql-insert
hbm.xml file does an update instead of an insert- Helppppp