You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Bob Hanson <mn...@gmail.com> on 2006/11/20 19:12:49 UTC

stored procedure parameter maps

It appears that stored procedure parameter maps must list parameters in the
same order as the parameters are listed in the stored procedure. Is that how
it is supposed to work or am I doing something wrong?

Looking at the code, it doesn't appear that the parameter object is used at
all. Thus it seems that the mapping is ignored. For stored procedure
parameter maps, what are the attributes "property" and "column" used for?

Re: stored procedure parameter maps

Posted by Bob Hanson <mn...@gmail.com>.
Ignore this email. I stepped into the code and found the error.

Message="There is no Set member named 'RecordingDocuments' in class
'RecordingPackage'"

Why doesn't iBATIS return that error message in the exception that
eventually makes it out of the library? That is much more informative than
what I received below.

On 11/20/06, Bob Hanson <mn...@gmail.com> wrote:
>
> One more related question. Is it possible to make "Section 3.5.12 Complex
> Collection Properties" work with stored procedures? I'm currently receive a
> configuration error with a mapping that looks like:
> <result property="RecordingDocuments" column="PackageNumber"
> select="SelectRecordingDocumentByPackageNumber" />
>
> SelectRecordingDocumentByPackageNumber uses a stored procedure and that's
> the only thing I can guess is wrong. If I remove the line that tries to map
> the list, everything works fine. Here is the error and partial stack trace:
>
> IBatisNet.Common.Exceptions.ConfigurationException was unhandled
>   Message="
> - The error occurred while loading SqlMap.
> - initialize result property: RecordingDocuments
> - The error occurred in <sqlMap resource=\"Maps/RecordingPackage.xml\"
> xmlns=\" http://ibatis.apache.org/dataMapper\<http://ibatis.apache.org/dataMapper%5C>"
> />.
> - Check the RecordingPackage.RecordingPackage-result."
>   Source="IBatisNet.DataMapper"
>   StackTrace:
>        at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
> document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean
> isCallFromDao) in
> C:\ibatis\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\DomSqlMapBuilder.cs:line
> 598
>        at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
> document, Boolean useConfigFileWatcher) in
> C:\ibatis\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\DomSqlMapBuilder.cs:line
> 698
>        at
> IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureAndWatch(String
> resource, ConfigureHandler configureDelegate) in
> C:\ibatis\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\DomSqlMapBuilder.cs:line
> 514
>        at
> IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureAndWatch(ConfigureHandler
> configureDelegate) in
> C:\ibatis\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\DomSqlMapBuilder.cs:line
> 478
>
>
> On 11/20/06, Bob Hanson <mn...@gmail.com> wrote:
> >
> > It appears that stored procedure parameter maps must list parameters in
> > the same order as the parameters are listed in the stored procedure. Is that
> > how it is supposed to work or am I doing something wrong?
> >
> > Looking at the code, it doesn't appear that the parameter object is used
> > at all. Thus it seems that the mapping is ignored. For stored procedure
> > parameter maps, what are the attributes "property" and "column" used for?
> >
> >
>

Re: stored procedure parameter maps

Posted by Bob Hanson <mn...@gmail.com>.
One more related question. Is it possible to make "Section 3.5.12 Complex
Collection Properties" work with stored procedures? I'm currently receive a
configuration error with a mapping that looks like:
<result property="RecordingDocuments" column="PackageNumber"
select="SelectRecordingDocumentByPackageNumber" />

SelectRecordingDocumentByPackageNumber uses a stored procedure and that's
the only thing I can guess is wrong. If I remove the line that tries to map
the list, everything works fine. Here is the error and partial stack trace:

IBatisNet.Common.Exceptions.ConfigurationException was unhandled
  Message="
- The error occurred while loading SqlMap.
- initialize result property: RecordingDocuments
- The error occurred in <sqlMap resource=\"Maps/RecordingPackage.xml\"
xmlns=\"http://ibatis.apache.org/dataMapper\" />.
- Check the RecordingPackage.RecordingPackage-result."
  Source="IBatisNet.DataMapper"
  StackTrace:
       at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean
isCallFromDao) in
C:\ibatis\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\DomSqlMapBuilder.cs:line
598
       at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
document, Boolean useConfigFileWatcher) in
C:\ibatis\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\DomSqlMapBuilder.cs:line
698
       at
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureAndWatch(String
resource, ConfigureHandler configureDelegate) in
C:\ibatis\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\DomSqlMapBuilder.cs:line
514
       at
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureAndWatch(ConfigureHandler
configureDelegate) in
C:\ibatis\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\DomSqlMapBuilder.cs:line
478


On 11/20/06, Bob Hanson <mn...@gmail.com> wrote:
>
> It appears that stored procedure parameter maps must list parameters in
> the same order as the parameters are listed in the stored procedure. Is that
> how it is supposed to work or am I doing something wrong?
>
> Looking at the code, it doesn't appear that the parameter object is used
> at all. Thus it seems that the mapping is ignored. For stored procedure
> parameter maps, what are the attributes "property" and "column" used for?
>
>

RE: stored procedure parameter maps

Posted by Paul Deweese <pd...@msfw.com>.
I have noticed the same thing with procedure parameter maps, that you
have to list ALL parameters and list them in the correct order.  If you
don't specify all the paramters then it doesn't work.  This is a pain
since a client may choose to add an optional parameter to a shared
procedure and then break our ibatis code.

________________________________

From: Bob Hanson [mailto:mnbob70@gmail.com] 
Sent: Monday, November 20, 2006 12:13 PM
To: user-cs@ibatis.apache.org
Subject: stored procedure parameter maps


It appears that stored procedure parameter maps must list parameters in
the same order as the parameters are listed in the stored procedure. Is
that how it is supposed to work or am I doing something wrong?

Looking at the code, it doesn't appear that the parameter object is used
at all. Thus it seems that the mapping is ignored. For stored procedure
parameter maps, what are the attributes "property" and "column" used
for?