ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilya Boyandin <Ilya.Boyan...@fh-joanneum.at>
Subject Using discriminator with an interface
Date Mon, 03 Sep 2007 08:39:17 GMT

Hello all,

is that possible to use discriminator with an interface without setters?

I have something like this in my mappings:

<resultMap id="somethingResult" class="ISomething">
    <discriminator column="type" javaType="string">
        <subMap value="black" resultMap="blackSomethingResult"/>
        <subMap value="white" resultMap="whiteSomethingResult"/>
    </discriminator>
</resultMap>

<resultMap id="blackSomethingResult" class="BlackSomething">
    ...
</resultMap>

<resultMap id="whiteSomethingResult" class="WhiteSomething">
    ...
</resultMap>

<select id="loadSomething" resultMap="somethingResult">
    ...
</select>

And I always get this RuntimeException: "resultMap 
Something.somethingResult must have at least one result mapping". But 
somethingResult can't have any mappings because ISomething is an 
interface without any setters.

Am I doing something wrong or is there any other way to accomplish this?

Thanks in advance
Ilya




FH JOANNEUM Gesellschaft mbH
Rechtsform/Legal form: GmbH
Firmenbuchgericht/Court of registry: Landesgericht für ZRS Graz
Firmenbuchnummer/Company registration: FN 125888 f
DVR: 0813559
UID-Nr.: ATU 42361001

Mime
View raw message