ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brandon Goodin" <brandon.goo...@gmail.com>
Subject Re: stored proc call with list items in parameter
Date Tue, 15 Apr 2008 13:48:36 GMT
We've looked into this in the past and for whatever reason haven't added
this feature. I think there were some difficulties. There is currently not a
way to refer to a particular index of a list in a parameter using notation.
You could flatten your parameters into a Map  and then pass the map in as a
parameter object. Please let me know if this is suitable for your situation.
If not, please expound on why it will not work for you.

Brandon Goodin

On Tue, Apr 15, 2008 at 8:04 AM, Darren Davison <darren@davisononline.org>
wrote:

> we're still struggling with this, using a fairly unsatisfactory
> workaround.. is there no way for iBATIS to parse such a thing?  I think
> the notation I'm trying to use is standard OGNL.. not sure what iBATIS
> is using.
>
> Any pointers would be appreciated :)
>
> Darren.
>
>
> On Tue, Jan 22, 2008 at 11:38:05AM +0000, Darren Davison wrote:
> > hi,
> >
> > is it possible to refer to list items from a parameter class in a call
> > to a stored proc?
> >
> > If I have a class as follows that I use as a paramaterClass:
> >
> > class Foo {
> >   List<Bar> bar;
> >   String name;
> >
> >   // getters/setters omitted
> > }
> >
> > class Bar {
> >   String name;
> >   //getters/setters omitted
> > }
> >
> >
> > .. and a SP mapping as follows:
> >
> > <procedure id="testSP"
> > parameterClass="com.example.Foo">
> > { CALL my_pkg.odd_sp_using_foo (
> >   #foo.name,mode=IN#,
> >   #foo.bar[0].name,mode=IN#)
> > }
> > </procedure>
> >
> > obviously the above fails with;
> > There is no READABLE property named 'bar[0]' in class
> > com.example.Foo
> >
> > Is there a way to make this work so that I can refer to indexed elements
> > in the list of Bar instances?
> >
> > Cheers,
> >
> > --
> > Darren Davison
> > Public Key: 0xE855B3EA
>
>
>
> --
> Darren Davison
> Public Key: 0xE855B3EA
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFIBKfVVgOfSOhVs+oRAm+/AKCm+xZt98WkCn+D5TtNBWaXIV3RTwCfctB/
> zsHloRGYRbr8f1Pf0+dJ22k=
> =6qAo
> -----END PGP SIGNATURE-----
>
>

Mime
View raw message