You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Lieven De Keyzer <li...@hotmail.com> on 2005/05/23 03:51:18 UTC

Blob

I want to retrieve the values from a table where 1 column is of type Blob. 
My Bean to store these values has a field of type java.sql.Blob and the 
appropriate getters and setters.

My resultmap looks like this:

<sqlMap namespace="Bookmark">

  <typeAlias alias="bookmark" type="com.vub.bookmarked.domain.Bookmark"/>

  <resultMap id="bookmarkResult" class="bookmark">
    <result property="bookmarkId" column="bookmark_id"/>
    <result property="folderId" column="folder_id"/>
    <result property="url" column="url"/>
    <result property="bookmarkname" column="bookmarkname"/>
    <result property="cache" column="cache"/>
  </resultMap>

When my webapplication actually needs this data, I get following exception:


Cause: com.ibatis.dao.client.DaoException: Failed to queryForList - id 
[getBookmarkListByParentId], parameterObject [71]. Cause: 
com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred 
in com/vub/bookmarked/persistence/sqlmapdao/sql/Bookmark.xml. --- The error 
occurred while applying a result map. --- Check the Bookmark.bookmarkResult. 
--- Check the result mapping for the 'cache' property. --- Cause: 
com.ibatis.sqlmap.client.SqlMapException: No type handler could be found to 
map the property 'cache' to the column 'cache'. One or both of the types, or 
the combination of types is not supported.


Isn't type Blob supported in iBatis? I have the latest version.



Re: Blob

Posted by Brandon Goodin <br...@gmail.com>.
umm... how dumb do you have to be to do something like that? uurmm...
oh yeah... i did that too!

Brandon

On 5/22/05, Larry Meadors <la...@gmail.com> wrote:
> One almost unrelated thing on this (that I have screwed up before) is
> that you may want to leave out the blob unless you really, really need
> it. :-)
> 
> Imagine 10-20 users in a web app loading up these lists...and all of
> those blobs getting suffed into memory. ;-)
> 
> Larry
> 
> 
> On 5/22/05, Lieven De Keyzer <li...@hotmail.com> wrote:
> > I want to retrieve the values from a table where 1 column is of type Blob.
> > My Bean to store these values has a field of type java.sql.Blob and the
> > appropriate getters and setters.
> >
> > My resultmap looks like this:
> >
> > <sqlMap namespace="Bookmark">
> >
> >   <typeAlias alias="bookmark" type="com.vub.bookmarked.domain.Bookmark"/>
> >
> >   <resultMap id="bookmarkResult" class="bookmark">
> >     <result property="bookmarkId" column="bookmark_id"/>
> >     <result property="folderId" column="folder_id"/>
> >     <result property="url" column="url"/>
> >     <result property="bookmarkname" column="bookmarkname"/>
> >     <result property="cache" column="cache"/>
> >   </resultMap>
> >
> > When my webapplication actually needs this data, I get following exception:
> >
> >
> > Cause: com.ibatis.dao.client.DaoException: Failed to queryForList - id
> > [getBookmarkListByParentId], parameterObject [71]. Cause:
> > com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred
> > in com/vub/bookmarked/persistence/sqlmapdao/sql/Bookmark.xml. --- The error
> > occurred while applying a result map. --- Check the Bookmark.bookmarkResult.
> > --- Check the result mapping for the 'cache' property. --- Cause:
> > com.ibatis.sqlmap.client.SqlMapException: No type handler could be found to
> > map the property 'cache' to the column 'cache'. One or both of the types, or
> > the combination of types is not supported.
> >
> >
> > Isn't type Blob supported in iBatis? I have the latest version.
> >
> >
> >
>

Re: Blob

Posted by Larry Meadors <la...@gmail.com>.
One almost unrelated thing on this (that I have screwed up before) is
that you may want to leave out the blob unless you really, really need
it. :-)

Imagine 10-20 users in a web app loading up these lists...and all of
those blobs getting suffed into memory. ;-)

Larry


On 5/22/05, Lieven De Keyzer <li...@hotmail.com> wrote:
> I want to retrieve the values from a table where 1 column is of type Blob.
> My Bean to store these values has a field of type java.sql.Blob and the
> appropriate getters and setters.
> 
> My resultmap looks like this:
> 
> <sqlMap namespace="Bookmark">
> 
>   <typeAlias alias="bookmark" type="com.vub.bookmarked.domain.Bookmark"/>
> 
>   <resultMap id="bookmarkResult" class="bookmark">
>     <result property="bookmarkId" column="bookmark_id"/>
>     <result property="folderId" column="folder_id"/>
>     <result property="url" column="url"/>
>     <result property="bookmarkname" column="bookmarkname"/>
>     <result property="cache" column="cache"/>
>   </resultMap>
> 
> When my webapplication actually needs this data, I get following exception:
> 
> 
> Cause: com.ibatis.dao.client.DaoException: Failed to queryForList - id
> [getBookmarkListByParentId], parameterObject [71]. Cause:
> com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred
> in com/vub/bookmarked/persistence/sqlmapdao/sql/Bookmark.xml. --- The error
> occurred while applying a result map. --- Check the Bookmark.bookmarkResult.
> --- Check the result mapping for the 'cache' property. --- Cause:
> com.ibatis.sqlmap.client.SqlMapException: No type handler could be found to
> map the property 'cache' to the column 'cache'. One or both of the types, or
> the combination of types is not supported.
> 
> 
> Isn't type Blob supported in iBatis? I have the latest version.
> 
> 
>

Re: Blob

Posted by Brandon Goodin <br...@gmail.com>.
This should help:

http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+use+a+Custom+Type+Handler+with+a+BLOB+or+CLOB%3F

Brandon

On 5/22/05, Lieven De Keyzer <li...@hotmail.com> wrote:
> I want to retrieve the values from a table where 1 column is of type Blob.
> My Bean to store these values has a field of type java.sql.Blob and the
> appropriate getters and setters.
> 
> My resultmap looks like this:
> 
> <sqlMap namespace="Bookmark">
> 
>   <typeAlias alias="bookmark" type="com.vub.bookmarked.domain.Bookmark"/>
> 
>   <resultMap id="bookmarkResult" class="bookmark">
>     <result property="bookmarkId" column="bookmark_id"/>
>     <result property="folderId" column="folder_id"/>
>     <result property="url" column="url"/>
>     <result property="bookmarkname" column="bookmarkname"/>
>     <result property="cache" column="cache"/>
>   </resultMap>
> 
> When my webapplication actually needs this data, I get following exception:
> 
> 
> Cause: com.ibatis.dao.client.DaoException: Failed to queryForList - id
> [getBookmarkListByParentId], parameterObject [71]. Cause:
> com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred
> in com/vub/bookmarked/persistence/sqlmapdao/sql/Bookmark.xml. --- The error
> occurred while applying a result map. --- Check the Bookmark.bookmarkResult.
> --- Check the result mapping for the 'cache' property. --- Cause:
> com.ibatis.sqlmap.client.SqlMapException: No type handler could be found to
> map the property 'cache' to the column 'cache'. One or both of the types, or
> the combination of types is not supported.
> 
> 
> Isn't type Blob supported in iBatis? I have the latest version.
> 
> 
>