ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject Re: Where is <subclass> element
Date Wed, 30 Aug 2006 23:38:46 GMT
Not sure what the subclass element does...never tried it.  But ... you can
probably use discriminator tag.  It's dosclosed as undocumented on the
wiki....  :-)

  <resultMap id="document" class="testdomain.Document">
    <result property="id" column="DOCUMENT_ID"/>
    <result property="title" column="DOCUMENT_TITLE"/>
    <result property="type" column="DOCUMENT_TYPE"/>
    <discriminator column="DOCUMENT_TYPE" javaType="string" >
      <subMap value="Book" resultMap="book"/>
      <subMap value="Newspaper" resultMap="news"/>

  <resultMap id="book" class="testdomain.Book" extends="document">
    <result property="pages" column="DOCUMENT_PAGENUMBER"/>

  <resultMap id="news" class="testdomain.Magazine" extends="document">
    <result property="city" column="DOCUMENT_CITY"/>

On 8/30/06, Jan Vissers <Jan.Vissers@cumquat.nl> wrote:
> I'm reading JIRA for ResultObjectFactory and came across this:
>     Factories are not the way to solve inheritance as described (yet
>     another contradiction in this request --first a complaint, and then
>     an intended use). We're going to support the <resultMap> <subclass>
>     element, as in the .NET version of the framework.
> I'm not seeing any of this in the manuals - is it not available in
> iBatis 2.2.0?

View raw message