Posts Tagged ‘ibatis’

Using Ibatis Typehandlers to fix Oracle Date “missing time”

Friday, June 25th, 2010

The Problem

When using Ibatis to retrieve Date type values, on Oracle 10g (some driver versions), the time portion of the value returned from the database is not mapped onto the Java object.


In DB: 02-JAN-10 13:30:00
In Java Object after mapping: 02-JAN-10 00:00:00

The Ibatis ResultMapper, snippet, looks like this:

<result property="savedDate" column="SAVED_DATE" javaType="java.util.Date" jdbcType="DATE"/>


Tags: , ,
Posted in Examples | 2 Comments »

Ibatis TypeHandlerCallback Enum Example

Friday, June 11th, 2010


You need Ibatis to perform custom processing before parameters are set on a Prepared Statement or after the results are retrieved from the result set. Maybe to convert Y/N to boolean, map results to custom objects etc


You probably want to look at implementing Ibatis’ TypeHandlerCallBack, the API docs for which are here

Tags: ,
Posted in Examples | No Comments »