-->
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: List versus Set with @ManyToMany
PostPosted: Thu Jan 08, 2009 10:00 am 
Newbie

Joined: Mon Feb 12, 2007 6:57 am
Posts: 9
Hi all,

I have the following mapping in my persistant class:

Code:
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "V_INT_HIERARCHY_INVESTMENT", joinColumns = @JoinColumn(name = "INVESTMENT_ID", referencedColumnName = "ID"), inverseJoinColumns = @JoinColumn(name = "INTERMEDIARY_ID", referencedColumnName = "ID"))
private List<IntermediaryOrganisation> hierarchyIntermediaryOrganisations;


When I save an instance of this persistant object, Hibernate attempts to delete all of the data from the V_INT_HIERARCHY_INVESTMENT mapping view, which of course, fails. If I change the type from List to Set, it all works fine (i.e. no delete is issued).

Any ideas why this is so?

Thanks

Nick


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2009 10:04 am 
Regular
Regular

Joined: Wed Oct 15, 2008 6:59 am
Posts: 103
Location: Chennai
becaz set is configured default for mapping.

**) specify the on delete restriction in tables ...

_________________
If u feel it will help you, don't forget to rate me....


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.