openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <adam....@cyberspaceroad.org>
Subject Re: callback on superclass
Date Thu, 06 Mar 2008 23:37:17 GMT
I wish it was that simple, but the annotation doesn't work either.

Do you have a mapped-superclass with an event listener?


Shibu Gope on 06/03/08 21:41, wrote:
> try @PrePersist annotation
> 
> On Thu, Mar 6, 2008 at 1:05 PM, Adam Hardy <adam.sql@cyberspaceroad.org> wrote:
>> I can't get a callback to work on my entity superclass.
>>
>>  I've mapped it like this:
>>
>>    <mapped-superclass class="org.permacode.atomic.domain.AtomicEntity"
>>      access="FIELD">
>>      <pre-persist method-name="prePersistCallBack" />
>>      <attributes>
>>        <basic name="ownerId">
>>          <column name="OWNER_ID" />
>>        </basic>
>>        <basic name="created">
>>          <column name="CREATED" />
>>          <temporal>DATE</temporal>
>>        </basic>
>>        <basic name="modified">
>>          <column name="MODIFIED" />
>>          <temporal>DATE</temporal>
>>        </basic>
>>        <version name="version">
>>          <column name="VERSION" />
>>        </version>
>>      </attributes>
>>    </mapped-superclass>
>>
>>
>>  The method prePersistCallBack() is on the superclass:
>>
>>      public void prePersistCallBack()
>>      {
>>          this.modified = new Date();
>>          logger.info("doing prePersistCallBack() - " + this + " - modified="
>>              + this.modified);
>>      }
>>
>>  I see no logging and I see the SQL statement contains the untouched modified value.
>>
>>  Is there anything extra in the mapped subclass entities which is needed for
>>  callbacks?


Mime
View raw message