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 <[EMAIL PROTECTED]> 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?

Reply via email to