expp wrote:
You've got a very strange mapping.
First, you should choose which association you want: unidirection or bidirectional?
1) if you want unidirectional association remove inverse="true" from InventoryItem.aliases. and remove Aliases.itemNumber
2) ... bidirectional: map item_num as property of InventoryItem and update them accordingly with state of InventoryItem.aliases collecton
I am new to hibernate so be gentle. First im not sure which one I need uni or bi directional. I really just need it so that when I read an item my item object that has an alias list get's filled with all alias that have the item-num that matches the item I'm calling so I assume I dont need bi-directional association.
Second... my senario would be to get Item item.item_num="4ckdr" and the mapping then gets all the item.aliases that have item_num="4ckdr". If I then take and add an item to the collection aliases and save the item with saveOrUpdate(item) it works fine, same when I change one of an items aliases on the collection. But if I delete and Item on the aliases collection and then saveOrUpdate(item) it doesnt delete that item from the database. It seems like this should work this way. Am I wrong?