ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject Re: SQL DELETE
Date Wed, 09 Aug 2006 04:44:26 GMT
Regardless of how huge your processes are and how complex your tables
are....you will need to execute delete commands against them, in order, so
as not to break relational integrity constraints.

The nice thing about iBATIS is that you can do batch deletes easily and as
much as you want.

I'm not sure what else your looking for, there's no magic here... ;-)

Cheers,
Clinton


On 8/8/06, Socheat KHAUV <khauv_socheat@yahoo.com> wrote:
>
> Yesh of coz your sql is right for two table,
>
> how about three table or more and more tables that have relationship
> together,
>
>
>
> <update id="saveSearchControls" parameterClass="map">
>       begin
>                delete ... and more
>                delete ...
>               delete from Child2 where parentId in select childId from
> Child1 where parentId = #value# ;
>               delete from Child1 where parentId = #value# ;
>
>               delete from Parent where parentId = #value# ;
>       end;
> </update>
>
> this is very huge proccess when we have complex tables,
>
> do we have another solution about problem ?
>
>
> *Clinton Begin <clinton.begin@gmail.com>* wrote:
>
> Of course for relational integrity, it would have to be:
>
> <update id="saveSearchControls" parameterClass="map">
>       begin
>               delete from Child where parentId = #value# ;
>               delete from Parent where parentId = #value# ;
>       end;
> </update>
>
> ;-)
>
> Clinton
>
> On 8/7/06, Larry Meadors < lmeadors@apache.org> wrote:
> >
> > Not like <select> can, no.
> >
> > I am hoping this will not turn into another "we can't use any
> > database-specific features" thread, but several databases (like
> > Oracle) will let you do things like this:
> >
> > <update id="saveSearchControls" parameterClass="map">
> >        begin
> >                delete from Parent where parentId = #value# ;
> >                delete from Child where parentId = #value# ;
> >        end;
> > </update>
> >
> > That is a nice workaround for environments where you are not allowed
> > to create stored procedures. ;-)
> >
> > Larry
> >
> >
> > On 8/7/06, Fred Janon <fjanon@yahoo.com> wrote:
> > > That said, is there a way in iBatis to mimic a CASCADE DELETE by
> > > executing several SQL statements in an iBatis SQL Map? Like selected
> > > the elements in the child table with the FK of the master table and
> > > deleting the selected child rows?
> > >
> > > The documentation says that we can even put several SQL statements in
> > > the SQL map if the JDBC driver supports it... Would it be the way to
> > do
> > > it?
> > >
> > > --- Clinton Begin <clinton.begin@gmail.com> wrote:
> > >
> > > > No.  iBATIS is not an Object Relational Mapper.  It is not aware of
> > > > relationships and therefore does not automatically delete related
> > > > records.
> > > >
> > > > Clinton
> > > >
> > > > On 8/7/06, Socheat KHAUV <khauv_socheat@yahoo.com> wrote:
> > > > >
> > > > > Do we have another way beside using trigger and  ON DELETE
> > CASCADE?
> > > > > this is DBMS functions,
> > > > >
> > > > > beside using DBMS
> > > > >
> > > > > Does iBatis can delete the child record auto when we delete the
> > > > master
> > > > > record ?
> > > > >
> > > > >
> > > > >
> > > > > *Nils Winkler <nils@nilswinkler.com>* wrote:
> > > > >
> > > > > In Oracle I define this at the table level using "ON DELETE
> > > > CASCADE" on
> > > > > the foreign key relationship.
> > > > >
> > > > > On Sun, 6 Aug 2006 23:13:31 -0700 (PDT), "Socheat KHAUV"
> > > > > said:
> > > > > > Dear iBatis user,
> > > > > >
> > > > > > Does iBatis support auto delete data dependency when we delete
> > > > master
> > > > > > record ?
> > > > > > if it is support could tell me way to do ?
> > > > > >
> > > > > > thank in advance,
> > > > > > PkayJava
> > > > > >
> > > > > >
> > > > > > ---------------------------------
> > > > > > Yahoo! Music Unlimited - Access over 1 million songs.Try it
> > free.
> > > > > --
> > > > > ==================================
> > > > > nils@nilswinkler.com
> > > > >
> > > > >
> > > > > ------------------------------
> > > > > Yahoo! Music Unlimited - Access over 1 million songs. Try it
> > > >
> > > free.<http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/+%0A
> > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>
> ------------------------------
> Yahoo! Messenger with Voice. Make PC-to-Phone Calls<http://us.rd.yahoo.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com>to
the US (and 30+ countries) for 2ยข/min or less.
>
>

Mime
View raw message