-->
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: inverse="true" toujours du côté many
PostPosted: Thu Feb 23, 2006 7:07 am 
Newbie

Joined: Mon Apr 19, 2004 5:56 am
Posts: 9
Bonjour à tous,
J'ai cru voir qu'une bonne pratique dans le mapping des relations one-to-many était de toujours fixer le côté many à inverse=true.
Ce qui fait que lorsque l'on veut effectuer une association, il faut explicitement demander dans le code avant de persister :

B.setA(A);
save(a);

Pourquoi doit on mettre inverse=true forcément sur le many alors que le inverse=false évite de réaliser le code précédent ?

Merci d'avance,
Benoît.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 23, 2006 8:32 am 
Beginner
Beginner

Joined: Thu Feb 16, 2006 9:53 am
Posts: 24
C'est expliqué ici :
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#performance-collections-mostefficentinverse

Quote:
This is because Collection.add() or Collection.addAll() must always return true for a bag or List (unlike a Set). This can make the following common code much faster.


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.