Oh well, thanks for the quick feedback. -----Original Message----- From: Bob Hanson [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 15, 2007 2:55 PM To: [email protected] Subject: Re: GroupBy & Constructors
Unfortunately GroupBy result maps do not currently support the constructor element. On 5/15/07, Chick, Brian <[EMAIL PROTECTED]> wrote: > I'm trying to use the groupBy attribute in conjunction with a > constructor. When using the groupBy attribute with the default > no-args constructor, it works great. Having issues using it when > specifing a constructor. My resultmap that looks like this: > > <resultMap id="ResultId" class="ResultClass" groupBy="TheUniqueId"> > <constructor> > <argument argumentName="inUniqueId" column="ID" > dbType="Integer"/> > <argument argumentName="inValOne" column="VAL_ONE" > dbType="string"/> > <argument argumentName="inValTwo" column="VAL_TWO" > dbType="string"/> > </constructor> > <result property="TheUniqueId" column ="ID" dbType ="Integer"/> > <result property ="ChildObject" > resultMapping="Domain.DataAccess.SqlMaps.ChildMapping"/> > </resultMap> > > Throws the following NullReferenceException: > > System.NullReferenceException was unhandled by user code > Message="Object reference not set to an instance of an object." > Source="IBatisNet.DataMapper" > StackTrace: > at > IBatisNet.DataMapper.MappedStatements.BaseStrategy.GetUniqueKey(IResul > tM ap resultMap, RequestScope request, IDataReader reader) > at > IBatisNet.DataMapper.MappedStatements.ResultStrategy.GroupByStrategy.P > ro cess(RequestScope request, IDataReader& reader, Object > resultObject) > at > IBatisNet.DataMapper.MappedStatements.ResultStrategy.MapStrategy.Proce > ss (RequestScope request, IDataReader& reader, Object resultObject) > at > IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForList[ > T] (RequestScope request, ISqlMapSession session, Object > parameterObject, > IList`1 resultObject, RowDelegate`1 rowDelegate) > at > IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForL > is t[T](ISqlMapSession session, Object parameterObject) > at IBatisNet.DataMapper.SqlMapper.QueryForList[T](String > statementName, Object parameterObject) > at > Quad.App.DataAccess.IBatis.BaseDataSource.<>c__DisplayClass59`1.<Query > Fo > rList>b__58() > . . . > > Any ideas would be appreciated. Thanks. >

