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: insert sql and function calls.
Date Fri, 06 Apr 2007 15:58:27 GMT
I can not think of a way to use the SelectKey tage to accomplish this task.
You might have to pull them before the insert is called.  Just set them on
your user POJO and send it your your insert.

Should be good to go then.

Nahtan

On 4/5/07, gumnaam@cox.net <gumnaam@cox.net> wrote:
>
> Hello All,
> I have just started using iBatis, and I have a question about insert
> statements.
> I see, that there is a selectKey for auto generated columns.
> My situation is I have table that has primary key which is auto generated
> using a
> sequence. I use the selectKey for this column.
> But there is another column, UUID, whose value is generated using a PL/SQL
> function call.
> So my sql is some thing like.
>
> <selectKey resultclass="int" keyproperty="id">select seq.nextval from
> dual</selectKey>
> insert into table (id,uuid,name) values (#id#,new_uuid(),#name#);
>
> Althought this results in proper insertion, the result object's uuid
> property is not set automatically.
> is there a way to have the uuid property of the result object set ?
>
> Similarly what about those columns , who get default values ? Does iBatis
> populate the
> corrosponding properties ?
>
> thanks
>
>

Mime
View raw message