You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Per Magne Bjornerud <PM...@interlect.co.jp> on 2006/09/22 08:14:09 UTC
Obtaining error messages instead of null values for bad data cases?
I'm using iBatis to let the user upload data with CSV files.
Some fields map to integer values in the object. If the CSV file
contains an mapping to an int field, but the CSV file contains a string
value - then iBatis maps this to 0. (or null for nullable types)
This causes the following issue: For CSV files with optional fields, I
cannot tell if the fields with null values are due to allowed null
values or bad data. And I need to know about the cases with bad data.
Is there any way to obtain this information when mapping with iBatis?
--
Per Magne Bjornerud
Re: Obtaining error messages instead of null values for bad data cases?
Posted by Gilles Bayon <ib...@gmail.com>.
Perhaps must you use a custom type handler.
On 9/22/06, Per Magne Bjornerud <PM...@interlect.co.jp> wrote:
> I'm using iBatis to let the user upload data with CSV files.
>
> Some fields map to integer values in the object. If the CSV file
> contains an mapping to an int field, but the CSV file contains a string
> value - then iBatis maps this to 0. (or null for nullable types)
>
> This causes the following issue: For CSV files with optional fields, I
> cannot tell if the fields with null values are due to allowed null
> values or bad data. And I need to know about the cases with bad data.
>
> Is there any way to obtain this information when mapping with iBatis?
>
> --
> Per Magne Bjornerud
>
--
Cheers,
Gilles
<a href="http://www.amazon.com/gp/registry/6JCP7AORB0LE">Wish List</a>