This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes OneToMany relationship Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "OneToMany relationship" Watch "OneToMany relationship" New topic
Author

OneToMany relationship

Will Myers
Ranch Hand

Joined: Aug 05, 2009
Posts: 319

Hi I need some help in mapping a relationship...

my tables look like:



I'm trying to map the CurrencyHolidays as a set inside the Currency object like so:



but this is causing an exception:



I can't change the database schema so what am i doing wrong?
Will Myers
Ranch Hand

Joined: Aug 05, 2009
Posts: 319

so contrary to what this says you need to add



to the id column in the source entity
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OneToMany relationship
 
Similar Threads
I need help with Hibernate
what us mean mappedBy="item" ?
Hibernate - Creating .hbm file for link table
Column index not populated?
Removing from collection in many-to-one bi-directional mapping not working