ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: update listener
Date Sat, 20 Aug 2005 04:23:48 GMT

If you want to do it at the DAO layer, you could write a dynamic proxy the 
intercepts all of your DAO method calls to perform the check. You could use 
naming conventions to determine whether the check is needed (i.e. all 
updateXxxxxxx() methods).

If you want to do it at the SQL Map layer, you can proxy SqlMapClient (which 
is an interface). You only need to trap the update() method to do the check.

Hope that helps.


On 8/18/05, ankur.kumar@axa.com.au <ankur.kumar@axa.com.au> wrote:
> As part of requirements in our project, we need to verify data before 
> update using timestamp algorithm 
> by comparing retrieved timestamp value and current value in timestamp 
> column. 
> This has to be done before every update statement. 
> At this point, I'm using a generic DAO which will be extended by all DAOs 
> and it has got method to do that. 
> But for every update statement it needs to be called explicitely. And it 
> will be DAO developers responsibility. 
> Is it possible to add listener with update statement or any other generic 
> approach ??
> Alliance Bernstein: Winner of Money Management "FUND MANAGER OF THE YEAR 
> 2005" 
> Member of the Global AXA Group
> *********************************************************************************
> Important Note
> This email (including any attachments) contains information which is 
> confidential and may be subject to legal privilege. If you are not 
> the intended recipient you must not use, distribute or copy this 
> email. If you have received this email in error please notify the 
> sender immediately and delete this email. Any views expressed in this 
> email are not necessarily the views of AXA. Thank you.
> **********************************************************************************

View raw message