[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-342) event listener (prepersist, preinsert) not firing
Emmanuel Bernard (JIRA)
noreply at atlassian.com
Thu Mar 6 21:25:33 EST 2008
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29725 ]
Emmanuel Bernard commented on EJB-342:
--------------------------------------
please attach a minimal reproducible test case.
> event listener (prepersist, preinsert) not firing
> --------------------------------------------------
>
> Key: EJB-342
> URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-342
> Project: Hibernate Entity Manager
> Issue Type: Bug
> Components: EntityManager
> Affects Versions: 3.3.1.GA
> Environment: jdk1.5.0_12, linux 2.6
> Reporter: Adam Hardy
>
> I have a superclass with several properties, including 'modified', a datetime field which a prepersistlistener should update.
> All my entities inherit this superclass.
> The superclass is mapped with the appropriate prepersist listener identifying the callback method to call.
> <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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list