You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by ibatis-new-user <sh...@judiciary.state.nj.us> on 2005/01/11 19:17:21 UTC
Insert for Complex object
Hi,
I understand that iBATIs 2.0.9 provides a simple way to map ResultSet to
Complex object. (e.g. Category has many Products
and Products has Items)
My question is, Can we do same thing for INSERT also??
e.g. If I want to insert Category object using StoredProcedure, what will be
the simplest way to do it in iBATIs?
can we write a ParameterMap for this kind of object mapping?
any help is appreciated.
Thanks,
shilpa
Re: Insert for Complex object
Posted by Clinton Begin <cl...@gmail.com>.
Yes, iBATIS supports stored procedures. It's fully documented in the
developer guide.
As for cascading updates, that is not supported and probably won't be.
It's a complex pattern that often ends up doing more damage than
good.
Clinton
On Tue, 11 Jan 2005 18:17:21 +0000 (UTC), ibatis-new-user
<sh...@judiciary.state.nj.us> wrote:
>
> Hi,
> I understand that iBATIs 2.0.9 provides a simple way to map ResultSet to
> Complex object. (e.g. Category has many Products
> and Products has Items)
>
> My question is, Can we do same thing for INSERT also??
> e.g. If I want to insert Category object using StoredProcedure, what will be
> the simplest way to do it in iBATIs?
> can we write a ParameterMap for this kind of object mapping?
>
> any help is appreciated.
> Thanks,
> shilpa
>
>
Re: Insert for Complex object
Posted by Larry Meadors <la...@gmail.com>.
Why not just use a loop or some other iteration technique? You are
talking about saving 3-4 lines of code per instance, which is not
terribly significant, IMO.
On Tue, 11 Jan 2005 18:17:21 +0000 (UTC), ibatis-new-user
<sh...@judiciary.state.nj.us> wrote:
>
> Hi,
> I understand that iBATIs 2.0.9 provides a simple way to map ResultSet to
> Complex object. (e.g. Category has many Products
> and Products has Items)
>
> My question is, Can we do same thing for INSERT also??
> e.g. If I want to insert Category object using StoredProcedure, what will be
> the simplest way to do it in iBATIs?
> can we write a ParameterMap for this kind of object mapping?
>
> any help is appreciated.
> Thanks,
> shilpa
>
>