These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Committing Bidirectional Associations
PostPosted: Sun Dec 14, 2008 12:07 am 
Newbie

Joined: Sun Dec 14, 2008 12:01 am
Posts: 5
Hi,

Here's my structure:


http://img247.imageshack.us/img247/2557/hudsvj5.jpg

I have mapped HudItemConfig like so:


Code:
[CompositeId(0)]
        [KeyManyToOne(1, Name = "Hud", Column = "HudId", ClassType = typeof(MCHud))]
        [KeyManyToOne(2, Name = "HudItem", Column = "HudItemId", ClassType = typeof(MCHudItem))]


My Hud is mapped like so:


Code:
[Set(0, Table = "HudItemConfigs", Inverse = true)]
        [Key(1, Column = "HudId")]
        [OneToMany(2, ClassType = typeof(MCHudItemConfig))]


I would like to be able to save and commit the only the Hud, but with this mapping I have to iterate through each HudItemConfig, save, and commit.

I understand that moving the "Inverse=True" to the other side would solve my problem, but unfortunately due to the circumstances I dont think that KeyManyToOne has one of those.

Is there any change I can get save/commit for the Hud only without the need to iterate through all HudItemConfigs?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2008 12:40 am 
Newbie

Joined: Sun Dec 14, 2008 12:01 am
Posts: 5
Hmm, also it would seem that I cannot retrieve the collection from the database. No exceptions or anything. Just no data.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.