ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <gumn...@cox.net>
Subject insert sql and function calls.
Date Thu, 05 Apr 2007 20:21:48 GMT
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 ?


View raw message