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
  • [no subject] Gavin McLeod
    • Re: Nathan Maves
    • Re: Larry Meadors
      • Re: Zoran Avtarovski
        • Re: Clinton Begin
      • Re: Nathan Maves
        • Re: Clinton Begin

Reply via email to