Set creation and update time with Hibernate in Xml mappings

Posted by Marco on Stack Overflow See other posts from Stack Overflow or by Marco
Published on 2010-04-14T05:16:30Z Indexed on 2010/04/14 5:23 UTC
Read the original article Hit count: 221

Hi,
I'm using Hibernate with Xml mappings. I have an entity that has two fields creationDate and updateDate of type timestamp, that have to be filled with the current UTC time when the entity is persisted and updated. I know about the existence of the @PrePersist and @PreUpdate annotations, but i don't know how to use their equivalent in my Xml mappings.

Again, i was wondering if Hibernate somehow supports natively the update and creation time set.

Thanks

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about hibernate-mapping