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 Nathan Maves <na...@gmail.com> on 2009/04/14 02:10:23 UTC
Re:
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 <mi...@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
>