ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom B." <tom.bloomfi...@gmail.com>
Subject Nested Beans not populating using SQL alias.
Date Mon, 18 Jul 2005 14:02:25 GMT
I saw this question had been asked earlier, with no reply, so I'll try
and re-phrase ;-)

I have a nested bean called "Bar", inside of a class "Foo".  I am able
to use a Map to populate this bean, IE:

<result property="bar.baz1" column="baz1" />
<result property="bar.baz2" column="baz2" />

However, when I use the "equivelant" SQL alias without a map:

SELECT
     baz1 AS "bar.baz1",
     baz2 AS "bar.baz2"
FROM
     foo

This SQL does not populate my nested bean.  Is this a bug?

My Classes would look like:

class Foo{
   private Bar bar;

   Bar getBar() {
     if(this.bar == null) {
       this.bar = new Bar();
     }
     return bar;
   }
   void setBar(Bar bar) {
     this.bar = bar;
   }
}
....
class Bar{
    String getBaz1() {}
    void setBaz1(String baz1) {}
    String getBaz2() {}
    void setBaz2(String baz2) {}
}
....


Thanks!
Tom

Mime
View raw message