Log « Table « JPA Q&A





1. Using PostUpdateEventListener to Log Changes to new table    forum.hibernate.org

Hi I am trying to use PostUpdateEventListener (PostUpdateEvent) to inspect changes and save them to a new object. No matter what I have tried I get a LazyInitializationException - no session. I am thinking it has something to do with the way the session is being flushed. Has anyone implemeted something like this? I may just write a regular old tried ...

2. create table logging    forum.hibernate.org

3. Printing table name in logs    forum.hibernate.org

I don't remember any such method that like getTableForEntity(Entity) in hibernate API. But you can refer to the package hibernate.cfg. While building session factory, hibernate builds of Map of table names. This map contains mapping between Entity and it's table name. You have to copy this Map to your local variable. And you can use it to print table name in ...