-->
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.  [ 1 post ] 
Author Message
 Post subject: Design question -- Inverse=true
PostPosted: Mon Jun 20, 2005 10:32 am 
Newbie

Joined: Mon Jun 20, 2005 10:22 am
Posts: 2
When you have a many-to-many relationship, say Artist-to-Genre and you designate one as Inverse=True is there a standard pattern for implementing a DB Facade to save the 'weak' end of the relationship?

FOR INSTANCE:

2 Classes: Artist and Genre have a many-to-many
Genre is Inverse=false
Artist is Inverse=True

The DBFacade is MusicRepository. It has a method called SaveArtist(Artist anArtist);

Should I make the Artist class keep a collection of Genres that the user 'removed' so that the SaveArtist method can loop over them and remove the Artist from the Genres and then persist the Genres?

Is there a pattern I should be following for this simple situation? I would like to hide the details of which end of the relationship is 'weak' from the user of my assembly.

Any suggestions would be appreciated.

Thanks.


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

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.