Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Audit Trail (aspectJ)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Edward F Sinaga  
View profile   Translate to Translated (View Original)
 More options Aug 9 2012, 9:43 am
From: Edward F Sinaga <e_fe...@yahoo.com>
Date: Thu, 9 Aug 2012 06:43:25 -0700 (PDT)
Local: Thurs, Aug 9 2012 9:43 am
Subject: Audit Trail (aspectJ)

Halo teman2,

saya ada beberapa pertanyaan mengenai audit trails:
1. Lebih baik kita melakukan audit trail di level service
(aspecJ / spring aop) / level dao (hibernate interceptor), atau
bahkan memakai trigger DB ya? dari beberapa artikel yang saya baca, banyak yg rekomen di level service. Tp mungkin temen2 disinin pengalaman untuk hal ini?

2. utk skrg, sy lagi coba di level service pake aspectJ. Bagaimana cara memakai aspectJ dengan bener ya? sebelum insert/update setiap data, sy ingin menambahkan informasi audit trail seperti createDate, createBy, updateDate, updateBy, dll.

@AfterReturning("@annotation(auditTrails) && args(model,..)")
public void audit(AuditTrails auditTrails, Model model) {
   //jika auditTrails == update --> setUpdateDate & setUpdateBy
   //jika auditTrails == create --> setCreateDate & setCreateBy

}

@AuditTrails(className = User.class, actionType = AuditTrailsActionType.CREATE)
public void add(User user){
   dao.insert(user);

}

Anotasi yang seharusnya dipakai apa ya? karena klo saya pake @AfterReturning, semua data auditTrail kosong.
Asumsi saya, data sudah di insert terlebih dahulu, baru audit trail dijalankan.

Saya coba menjadi @Before, createDate & createBy sudah terisi dengan baik. Hanya saja, jika sy melakukan update, ke dua ata ini menjadi null, dan updateDate, updateBy. Seharusnya, jika update field createDate & createBy tidak hilang.
Asumsi sy untuk kasus ini, pas proses create, model yang dilempar itu 'baru dibuat'. begitu jg untuk proses update.

Dan jika sy coba @After, sama seperti @AfterReturning.

Mungkin ada saran dari temen2 untuk melakukan hal ini dengan baik?

Mohon bantuan nya ;)
Thanks,
E


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »