posted 10 years ago
Dear Sirs et Madames;
I have an application in which there are a number of persistent entities. All these entities have a few things in common, they all have the fields insertedBy, insertedDate.
The insertedBy field is the currently logged in user. My Dao interface looks like so:
and my EntityCrud Interface looks like so:
EntityCrudImpl looks like:
My question is: I need the two properties of an entityItem insertedBy, insertedDate updated whenever the create() method (which effectively is the method which persists the entityItem) is called. I got it into my head to use Spring AOP and to create an aspect to achieve this, however as am kind of new to Spring AOP could anyone tell me how this could be achieved, and the merits of using aspects to achieve it? Is there an example where one has used aspects for auditing which I could maybe have a look at?
Any help would be greatly appreciated.