-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Ask for help! about Hibernate eventListener
PostPosted: Thu Mar 17, 2011 6:28 am 
Newbie

Joined: Thu Mar 17, 2011 5:09 am
Posts: 1
In our developing work, there is a requirement which is recording log. The log can be classified into two kinds: action log which includes business meaning and data log which just includes data change.

In our planning, action log and data log are realized separately. A struts2 interceptor is used to record action log and hibernate eventListener is used to record datalog.

Then, a link ID is designed to build relationship between the both logs. In the design, when an action happens, the ID is added into a domain entity. When the entity is inserted or updated in the database, hibernate eventListener will get the ID value and record it with data log. Because the ID value will not be recorded in the database with domain entity, we don't deploy it in hibernate-mapping file.

However, in actual work, we find that hibernate will filter the ID if it isn't deployed in hibernate-mapping file. Deploying the ID in every domain entity will bring weighty labor load to our developing job for the project duration has outdistanced half.

So could you help me to solve the problems like: how can we get the ID in eventListener? If it is hard to realize, how can we get the ID from domain entity with a alternative solution in case that the ID need not be deployed in hibernate-mapping file.

We are eagering for your reply and appreciate your kind help!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.