-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audit Support #4
Comments
Source code and Status can be accessed at DnAuditor Sourceforge
For example After first change ie, converting name into upper case Only the dirty fields are stored
AuditLog table may be split into two table header and dtl. Can be defined by the developer using jdo mapping. One-One RelationShip - Audit trail
TODO : Give examples. Describe how to capture changes to child objects and relations
TODO : Give examples , Describe how to capture changes to child objects and relations
TODO : Give examples. Describe how to capture changes to child objects and relations. Describe how undo buffers are stored.
TODO : Give examples.
TODO : Give examples.
TODO : Give examples. |
This was taken from a Wiki post, so put here as a placeholder in case someone can implement it.
I like to implement auditing feature for JDO objects. Auditing means different for different people. So i'll explain my requirements
Req 1 :
History :- When an object is created/modified the old and new values are stored in a separate location. This feature is in lines with hibernate-envers. For now this is of low priority.
Req 2 :
AuditMaker :- When an object is created/modified the author,role,timestamp should be additionally captured and stored.
Lets study Req2 :
AuditMaker can be designed to be part of the domain model ie, create an interface with author,role,timestamp and implement this interface across the domain. This pollutes my domain model, further audit is a cross concern not needed in all projects/customers. I should be enabled only when I need.
Another option is to handle this via metadata. Introduce an annotation @Auditable. All @Auditable classes will automatically get three additional fields. In similar lines with JDO Versioning. With @Version the data object automatically gets a version field.
Another issue is capturing the userid and his role. Need to design some kind of extension point.
Question
Where do I start? One option seems to be Lifecycle Callbacks. Since I need to enhance the data object Lifecycle Callbacks may not be a good option.
If I choose to write a datanucleus plugin , which plugin point is appropriate for this requirement?
Has any one already implemented similar stuff ?
Any thoughts on this are welcome.
The text was updated successfully, but these errors were encountered: