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 "Nicholas L. Piasecki" <ni...@piasecki.name> on 2007/10/16 17:08:02 UTC
+ fails
All,
I'm trying to be lazy (!) and use a <resultMap> with class="Hashtable" to
return some legacy information from our data store. It works great until I
add a <result> with a "select" attribute. If I add the select, iBATIS throws
an exception during load.
For example:
<resultMap
id="ResultMapEndOfDayReportLegacyLine"
class="Hashtable">
<result
column="EndOfDayReportAmountTotal"
property="AmountTotal"
type="decimal" /> <!-- This works a treat, shows up as "AmountTotal"
in the Hashtable -->
<result
column="EndOfDayReportPaymentId"
property="Payment"
select="Payment.GetPaymentByPaymentId" /> <!-- Adding this generates
error -->
</resultMap>
I can just create a quick dummy class to hold the data for now, but has
anyone else seen this error? Is it a bug or am I doing something
intrinsically wrong?
Thanks. The stack trace is below.
V/R,
Nicholas Piasecki
{"Object reference not set to an instance of an object."}
at
IBatisNet.DataMapper.MappedStatements.PropertyStrategy.SelectStrategy..ctor(
ResultProperty mapping, IPropertyStrategy selectArrayStrategy,
IPropertyStrategy selectGenericListStrategy, IPropertyStrategy
selectListStrategy, IPropertyStrategy selectObjectStrategy)
at
IBatisNet.DataMapper.MappedStatements.PropertyStrategy.PropertyStrategyFacto
ry.Get(ResultProperty mapping)
at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Initialize()
at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean
isCallFromDao)
Re: + fails
Posted by Jakub Scheibe <ja...@gmail.com>.
<result column="EndOfDayReportPaymentId" property="Payment" select="
Payment.GetPaymentByPaymentId" />
Do u have any select statement called Payment.GetPaymentByPaymentId in your
map file?
You r trying to call another select from result map. If there is any section
like
<select id="Payment.GetPaymentByPaymentId" parameterClass="Hashtable"
resultMap="something">
SELECT JUST_ONE_FIELD
FROM TABLE
</select>
try to change id name to just GetPaymentByPaymentId and make sure that
result map of that select will return only one field.
Cheers,
Jakub
On 16/10/2007, Nicholas L. Piasecki <ni...@piasecki.name> wrote:
>
> All,
>
> I'm trying to be lazy (!) and use a <resultMap> with class="Hashtable" to
> return some legacy information from our data store. It works great until I
> add a <result> with a "select" attribute. If I add the select, iBATIS
> throws
> an exception during load.
>
> For example:
>
> <resultMap
> id="ResultMapEndOfDayReportLegacyLine"
> class="Hashtable">
> <result
> column="EndOfDayReportAmountTotal"
> property="AmountTotal"
> type="decimal" /> <!-- This works a treat, shows up as
> "AmountTotal"
> in the Hashtable -->
> <result
> column="EndOfDayReportPaymentId"
> property="Payment"
> select="Payment.GetPaymentByPaymentId" /> <!-- Adding this
> generates
> error -->
> </resultMap>
>
> I can just create a quick dummy class to hold the data for now, but has
> anyone else seen this error? Is it a bug or am I doing something
> intrinsically wrong?
>
> Thanks. The stack trace is below.
>
> V/R,
> Nicholas Piasecki
>
> {"Object reference not set to an instance of an object."}
> at
>
> IBatisNet.DataMapper.MappedStatements.PropertyStrategy.SelectStrategy..ctor
> (
> ResultProperty mapping, IPropertyStrategy selectArrayStrategy,
> IPropertyStrategy selectGenericListStrategy, IPropertyStrategy
> selectListStrategy, IPropertyStrategy selectObjectStrategy)
> at
>
> IBatisNet.DataMapper.MappedStatements.PropertyStrategy.PropertyStrategyFacto
> ry.Get(ResultProperty mapping)
> at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Initialize()
> at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build
> (XmlDocument
> document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean
> isCallFromDao)
>
>
>