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: @PreUpdate + Cascade
PostPosted: Fri Oct 27, 2006 4:11 am 
Newbie

Joined: Thu Oct 05, 2006 2:04 am
Posts: 3
Hi,

i have an entity, for example class B, with an @OneToMany-Association to an other entity, for example class A.

The cacadetyp is set to ALL.
@OneToMany(cascade = {CascadeType.ALL})
public List<B> getB() {
return b;
}

I have create a @PreUpdate callback method, in wich i change the associated elements.
@PreUpdate
public void adaptB() {
for (B element : b) {
element.setValue("test");
}
}

I would like to make the changes in the associated elements persistent. (merge cascading)

The problem is, that in every test case the changes of one element (the first in the associated list) are not make persistent. The changes of the other elements can be viewed in the database.

Is this a bug? Alternatives?


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.