ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Maves <nathan.ma...@gmail.com>
Subject Re:
Date Tue, 14 Apr 2009 00:10:23 GMT
can you turn on logging to see what values ibatis is sending to the insert?

On Mon, Apr 13, 2009 at 5:49 PM, Gavin McLeod <mister.mccleod@gmail.com>wrote:

> I have the following:
>
> <insert id="insert" parameterClass="domain.Thing">
>   insert into thing (thing_id, animal, mineral, vegetable)
>   values (
>       #thingId#,
>       #animal:BOOLEAN:False#,
>       #mineral:BOOLEAN:False#,
>       #vegetable:BOOLEAN:False#
>   )
> </insert>
>
> When iBatis executes the above an exception is thrown:
>
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in ibatis/business.xml.
> --- The error occurred while applying a parameter map.
> --- Check the Business.insert-InlineParameterMap.
> --- Check the statement (update failed).
> --- Cause:
> com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException:
> Column 'animal' cannot be null
>       at
> com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
>       at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
>
>
> My understanding here is that if the JavaBean property returns a null
> value that it is substituted for the value specified in the
> parameterMap. The Exception tends to discount this interpretation.
>
> What am I missing?
>
> Thanks in advance
> Gav
>

Mime
View raw message