openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kelvin Law <>
Subject PreUpdate on MappedSuperClass
Date Tue, 21 Sep 2010 22:35:46 GMT

I have a MappedSuperClass which has a @PreUpdate annotation on a method.

The @PreUpdate method only has one line like below:
	this.updateTime = new Date();

(and updateTime is actually mapped to a column)

I noticed that there are some unnecessary sql being generated when I tried to update the entities...

For example: Update SOME_TABLE set UPDATE_TIME = <some_date> where ID = ? and VERSION
= ?

And because of this sql statement, OpenJPA will throw JpaOptimisticLocking (because it cannot
update the entity with the specific version).

I have tried to comment out the @PreUpdate method then everything works fine. (except that
I cannot have the last modified time of the entity).

So my question is, is this a bug? and is there any work around for that?

I am using OpenJpa 1.2.2


View raw message