Hibernate version: 2.1.8
Hi all,
I've got a conceptual question about hibernate.
I've got a service which have two functions
public Entity service.get(Entity)
public Entity service.update(Entity)
I've got to implement a business rule apply on a property of Entity
object in update function.
The problem is :
The two methods are call in the same transaction which is propaged by Spring so if a user change values of Entity between calls of get and update
functions, I did not have the old values of Entity.
I can put a function getOldEntityValues(id) in DAO layer using HQL
I can set an interceptor on preFlush or flushDirty
I don't like this two methods, is there a best way ??
|