Using null value replacement like #id:NUMERIC:-999999# doesn't act like a
default value.  In fact, it acts quite the opposite way.  It was originally
implemented to allow nullable fields in the database to be mapped to
primitive Java types (non-nullable).  Because it was so hard to understand,
it's been removed in iBATIS 3.

So, that won't help you.

Based on your comment and without your code, it seems to me you're asking
how to avoid a SQL exception when you don't pass in a parameter.
Unfortunately, you have to pass in every parameter that you specify.  You
would get the same error with plain JDBC.

Clinton

On Mon, Feb 1, 2010 at 2:51 AM, rajnishp <hi_rajn...@yahoo.com> wrote:

>
> Hi,
> IBatis throws SQL exception while inserting data using InlineParameterMap
> :--
>
> The error occurred while applying a parameter map.
> --- Check the insertAllocationInstruction-InlineParameterMap.
> --- Check the parameter mapping for the 'userID' property.
> --- Cause: java.sql.SQLException: Invalid column type
>
> Ibatis throws error because the attribute userID is not set while inserting
> data in database(Oracle 10g).
> After doing googling I got help in
> http://ibatisnet.sourceforge.net/DevGuide.html
> Solution provided :--
>                      <statement id=”insertProduct”
> parameterClass=”product”>
>                       insert into PRODUCT (PRD_ID, PRD_DESCRIPTION)
>                      values (#id:NUMERIC:-999999#,
> #description:VARCHAR:NO_ENTRY#);
>                      </statement>
> Providing Default value if attribut not set.
>
> This solution is not working.
>
> Please provided correct solution solution (Only by IBatis not setting
> default value in POJO)
>
> Thanking In Advance.
>
>
>
>
>
> --
> View this message in context:
> http://old.nabble.com/IBatis2.3.4-throws-%3A-java.sql.SQLException%3A-Invalid-column-type-when-property-is-not-set-in-POJO-while-inserting-data.-tp27401733p27401733.html
> Sent from the iBATIS - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@ibatis.apache.org
> For additional commands, e-mail: dev-h...@ibatis.apache.org
>
>

Reply via email to