-->
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: A remove from list problem
PostPosted: Fri Feb 15, 2008 7:02 am 
Newbie

Joined: Fri Feb 15, 2008 6:48 am
Posts: 2
Hello
I Have a Object with a List, the mapping:
Code:
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "XXX")
    @IndexColumn(name = "ORDERNUMBER", base = 0)
    public List<Element> getElement() {


e.g.: now, I have 2 Elements in the list and in the table of my DB,
if I remove one Element from my list, then the record keep in my table.
the linking from my record to the mother object is indeed on null
in this case the JoinColumn XXX change from oid to null, but the record
keep still in DB.

What I have to do, that the record removes from my DB, when I remove it from the list?

Can anybody help me?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 15, 2008 9:25 am 
Newbie

Joined: Fri Feb 15, 2008 6:48 am
Posts: 2
I have it
Code:
@Cascade( { org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN })


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.