-->
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: Beginners question
PostPosted: Thu Dec 11, 2008 10:36 am 
Beginner
Beginner

Joined: Wed Dec 10, 2008 5:59 am
Posts: 47
Hi,

I would be very greatful if anyone would be happy to share their insight with me on this question.

I have the following tables:

territory
territory_person
person


The idea is that one person can belong to several territories. I have mapped Person to Territory like this:

Code:
<set name="territories" lazy="false" table="territory_person" cascade="none">
<key column="person_id"/>
<many-to-many column="territory_id" class="database.entities.Territory" />
</set>


Territory is mapped without any references to person, as i want to avoid generating too many queries.

However, how would i go about so that every time i delete a territory, the association between the territory and the person would automatically be removed? As i see it right now, i would have to issue a manual SQL query for that...?

Any other ideas?


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.