ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Chandler <a...@chandlerfamily.org.uk>
Subject Re: confused about storing image data in my database
Date Tue, 08 Nov 2005 00:55:01 GMT
On Monday 07 Nov 2005 23:10, Jeff Butler wrote:
> Ah...sorry.
>  This is sometimes hard to work through. The problem is that bytea doesn't
> map easily to a JDBC type - hence the posgresql documentation telling you
> exactly what JDBC method to call. If bytea means that you should call
> getBytes(), then I think you should use a byte[] in your bean, but NOT
> specify type of BLOB in the result map. This will cause iBATIS to use the
> ByteArrayTypeHandler, which calls getBytes().
>  You can see how iBATIS decides what to do by looking at the class
> com.ibatis.sqlmap.engine.type.TypeHandlerFactory. If there is a property of
> type byte[], and JDBC type is not BLOB or LONGVARBINARY, then iBATIS will
> use the ByteArrayTypeHandler - which should do what you want.
>  I hope I understand it this time :)

Thanks that is exactly what I was after.

Alan Chandler
Open Source. It's the difference between trust and antitrust.

View raw message