Hi Cameron, it's a pleasure talking to you
The example from
http://java-aap.blogspot.com/2006/04/hibernate-annotations-composite.html is a little too advanced for me.
I have only two days experience with hibernate and have read half and a little tutorial from your site
http://www.hiberbook.com/HiberBookWeb/learn.jsp All I understood from the example was that if a join table has its own properties a new POJO should be created
Now for the magic:
I've added 2 extra getters and setters for Product and Item to make it easier to get or set a product or item on your primary key. I added to extra columns to make hibernate think there is a Product mapped to this table (and an Item) but hibernate never updates or inserts this property (becuase it doensn't exists in our db.) But when hibernate does the getProduct() method it will retrieve the Product from our composite foreign key and all will work fine!
I don't understand this magic. Right now it seems to me like a hack
Thanks
[ May 19, 2008: Message edited by: Marcin Mogiela ]