Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 73052 invoked from network); 31 Mar 2009 13:20:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Mar 2009 13:20:42 -0000 Received: (qmail 44791 invoked by uid 500); 31 Mar 2009 13:20:42 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 44775 invoked by uid 500); 31 Mar 2009 13:20:41 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 44767 invoked by uid 99); 31 Mar 2009 13:20:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2009 13:20:41 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [63.249.95.37] (HELO mail.cruzio.com) (63.249.95.37) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2009 13:20:34 +0000 Received: from [192.168.0.105] (dsl-63-249-101-4.cruzio.com [63.249.101.4]) by mail.cruzio.com with ESMTP id n2VDKDbQ045621 for ; Tue, 31 Mar 2009 06:20:13 -0700 (PDT) Message-Id: From: Richard Yee To: "user-java@ibatis.apache.org" In-Reply-To: Content-Type: multipart/alternative; boundary=Apple-Mail-1-352888672 X-Mailer: iPhone Mail (5H11) Mime-Version: 1.0 (iPhone Mail 5H11) Subject: Re: How to Compare database record before UPDATE using iBatis? Date: Tue, 31 Mar 2009 06:20:09 -0700 References: X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-1-352888672 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Why don't you override the Object.hashcode() method on your VO and call it and save the value when you retrieve the record. Call it again when the user submits their changes. If the values are different, the a change was made. -Richard Sent from my iPhone On Mar 31, 2009, at 4:54 AM, Jasmin Mehta wrote: > > I thought the Subject line of my question earlier was kind of > misleading. Here is the same question with suitable subject line. > > > From: Jasmin Mehta > To: user-java@ibatis.apache.org > Date: 03/31/2009 07:50 AM > Subject: Check database before INSERT in iBatis > > > > > Hi, > > I have customer registration web application. Where it takes 3 pages > to complete the process before submit. Once customer is registered, > i.e. the records are inserted into 3 different tables then user can > edit the registration. > > Right now, I have a code that retrieves the record from each table > and store it into Value Object class (model) and keep that into > session until I update the records at the end of 3 pages. I update > the record only if any value is different from VO to new ActionForm > being edited else not updating. > > Is there any shorter way of doing this task in iBatis? > > Thanks > Jasmin > > *** > *** > *** > ********************************************************************* > This email and any files transmitted with it are intended solely for > the use of the individual or agency to whom they are addressed. > If you have received this email in error please notify the Navy > Exchange Service Command e-mail administrator. This footnote > also confirms that this email message has been scanned for the > presence of computer viruses. > > Thank You! > *** > *** > *** > ********************************************************************* > > --Apple-Mail-1-352888672 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
Why don't you override the Object.hashcode() method on your VO         and call it and save the value when you retrieve the record. Call it again when the user submits their changes.
If the values are different, the a change was made. 

-Richard


Sent from my iPhone

On Mar 31, 2009, at 4:54 AM, Jasmin Mehta <Jasmin_Mehta@nexweb.org> wrote:


I thought the Subject line of my question earlier was kind of misleading. Here is the same question with suitable subject line.


From: Jasmin Mehta <Jasmin_Mehta@nexweb.org>
To: user-java@ibatis.apache.org
Date: 03/31/2009 07:50 AM
Subject: Check database before INSERT in iBatis





Hi,

I have customer registration web application. Where it takes 3 pages to complete the process before submit. Once customer is registered, i.e. the records are inserted into 3 different tables then user can edit the registration.

Right now, I have a code that retrieves the record from each table and store it into Value Object class (model) and keep that into session until I update the records at the end of 3 pages. I update the record only if any value is different from VO to new ActionForm being edited else not updating.

Is there any shorter way of doing this task in iBatis?

Thanks
Jasmin

******************************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or agency to whom they are addressed.
If you have received this email in error please notify the Navy
Exchange Service Command e-mail administrator. This footnote
also confirms that this email message has been scanned for the
presence of computer viruses.

Thank You!           
******************************************************************************


--Apple-Mail-1-352888672--