The better way to do that would be through generated values. For an update or creation date/time that is super easy and Hibernate will even handle setting the value for you - see @CreationTimestamp or @UpdateTimestamp For the user, whether generated values will work depends a bit on how you know the user to set. Considering you had access to that information inside a custom persister, I’m guessing you’d have access to it inside a custom BeforeExecutionGenerator` as well. If not, a custom event listener or Interceptor would work. |