-->
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: unexpected/inconsistent behaviour in @PreUpdate, @Prepersit
PostPosted: Tue Nov 27, 2007 10:53 am 
Newbie

Joined: Tue Nov 27, 2007 10:43 am
Posts: 1
Hibernate version: 3.2

hi

i don´t know if i hit a bug. I´m using JPA and have the following problem.
some Entity has:

@PrePersist @PreUpdate
public void updateEntity1()
{
this.entity1.setFoo("newFoo");
this.entity1.setBar(someBar);
}

while Bar is a mapped entity, which is persisted already. Foo is a simple member (String)
Entity1 has a ManyToOne relation to Bar.

on storing of the above Entity, the code in updateEntity is executed, but when committing, entity1 has its foo column changed, but the bar column is NOT! (While the members are as expected)

If i call updateEntity1 myself in transaction, everything works fine and as expected.

seems, as if bar is not marked dirty?!

any idea how to work around this?

thanks, uwe


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.