-->
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.  [ 3 posts ] 
Author Message
 Post subject: delete Entity wich is used in unidirectional ManyToMany
PostPosted: Wed Jun 24, 2009 6:53 am 
Newbie

Joined: Mon Mar 10, 2008 3:07 am
Posts: 7
Hi

I've an unidirectionnal ManyToMany relationship like that :
Hi, I am having trouble deleting an entity in a unidirectional manytomany relationship:

Code:
@Entity
class Flag{
@Id
Long id;
}

@Entity
class Mail{
@Id
String id;
@ManyToMany
Set<Flag> flags;
}


I can have a large number of Mail wich use one Flag so i would like to be able to delete a Flag without to select & edit each Mail wich use it.

The only solution i've found to do that consist to execute native SQL queries on my DB. However entity manager cache & 2nd level cache will not be refreshed.

Have you any suggestions ?

Thanks for your help

PHaroZ


Top
 Profile  
 
 Post subject: Re: delete Entity wich is used in unidirectional ManyToMany
PostPosted: Wed Nov 17, 2010 10:16 am 
Newbie

Joined: Thu Oct 07, 2010 11:19 am
Posts: 6
Hi,
I am facing the same issue, does any know the solution?

Regards.


Top
 Profile  
 
 Post subject: Re: delete Entity wich is used in unidirectional ManyToMany
PostPosted: Wed Nov 17, 2010 10:23 am 
Newbie

Joined: Mon Mar 10, 2008 3:07 am
Posts: 7
At this time, I've nothing better that :
Quote:
The only solution i've found to do that consist to execute native SQL queries on my DB. However entity manager cache & 2nd level cache will not be refreshed.

sorry


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.