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
|