-->
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-one and cascading deletes
PostPosted: Wed Dec 22, 2004 12:24 am 
Newbie

Joined: Wed Dec 22, 2004 12:06 am
Posts: 2
I have a model with several many-to-one relationships.

Essentially something like this:

<many-to-one name="property" class="Class"
column="COLUMN_ID" cascade="all" />

An example model might contain a Person, Role, and Participant relationshp where Participant is the combincation of a person, role and some relationship with some other entity.

The scenario I want to support would be for a person to participate (in the same or different roles) on different eitities. Ideally when the participation was deleted the person would be deleted if and only if it was the last relationship between that person and any participation. So the relational model is one person to many participations, but the application (or object tier) views it as a one-to-one between participation and person.

Is this possible with Hibernate - I can't seem to figure it out. Is this a problem with the model instead and not the tool?

Any thoughts appreciated.

Laine


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.