ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Friedrich <stephen.friedr...@fortis-it.eu>
Subject resultType="byte[]"
Date Mon, 25 Jan 2010 12:54:59 GMT
Is there a way to directly return a byte[] result (reading from a blob column)?

This works fine:
XML:
    <select id="selectContent" resultType="com.acme.ByteArrayDto">
        select content from manual where key = #{key,jdbcType=VARCHAR}
    </select>
Interface:
   ByteArrayDto selectContent(@Param("key") String key);
Groovy class:
   package com.acme.dtos
   class ByteArrayDto {
       byte[] content;
   }

However it would be nicer to do away with the DTO wrapper:
XML:
    <select id="selectContent" resultType="byte[]">
        select content from manual where key = #{key,jdbcType=VARCHAR}
    </select>
Interface:
   byte[] selectContent(@Param("key") String key);

Unfortunately that results in a "no class def found" for "byte[]".

Is there a way to make this work?

Mime
View raw message