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: Many to Many fonctionnel svp
PostPosted: Fri Dec 15, 2006 12:31 pm 
Newbie

Joined: Wed Sep 13, 2006 4:30 pm
Posts: 4
(ASP.NET 2.0, Nhibernate 2.2, MySQL)
Bonjour,

J'ai de la difficulté à gérer les Many-To-Many.

Ex.: 2 classes: Content & Playlist

- Un Content peut etre dans plusieurs Playlist.
- Un Playlist à plusieurs Content.

Donc 3 tables:
- contents, playlists, contents_playlists

Antérieurement, comme je ne réussissais pas à faire fonctionner un Many-To-Many correctement, je créais une classe qui s'appellais ContentPlaylist et qui faisais 2 Many-To-One:

Content -> ContentPlaylist <- Playlist (!!!)

Je devais donc mapper cette nouvelle classe (ContentPlaylist)

Et j'étais pris pour avoir une table avec les champs suivants (contents_playlists):
- IdContentPlaylist PK
- IdContent FK
- IdPlaylist FK

Mon champ IdContentPlaylist est très peu efficace, et ma table permettait la duplication (IdContent vs Playlist).

Quelqu'un possède-t-il la solution ultime des Many-To-Many.

Et qu'utilisez vous entre des bag, set, list et map?!?

Merci beaucoup!






[/b]


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.