ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakub Scheibe" <jakub.sche...@gmail.com>
Subject Select problem...
Date Thu, 15 Mar 2007 11:40:43 GMT
Hi,

I have 3 classes:

class1
{
   public string id;
   public class2 _class2;
}

class2
{
  public class3 _class3;
}

class3
{
  public string test;
}

The problem is when I'm trying to execute select command.
I have 2 sqlmap.xml file for class1 and class3.
f.e.

class1.xml

    <resultMap id="rmSelectClass1" class="Class1">
      <result property="Id" column="ID"/>
      <result property="Test" column="Test" select="SelectClass3"/>
    </resultMap>

    <select id="Class1Select" resultMap="rmSelectClass1">
      select *
      from my_table
    </select>

class3.xml

    <resultMap id="rmSelectClass3" class="Class3">
      <result property="Test" column="Test"/>
    </resultMap>

    <select id="SelectClass3" resultMap="rmClass3"">
        select Test
        from my_table2
    </select>

When i'm runing my test i'm getting following error:
Unable to cast object of type 'Class3' to type 'Class2'

Any help?

Mime
View raw message