ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Pannell <steven.pann...@zooplus.com>
Subject Getting the generate primary key
Date Thu, 17 Mar 2005 15:52:25 GMT
Hi,

I want to get the automatically generated key from a newly inserted row (my
oracle database handles the generation of the key via a trigger).  

I followed the docs but it does not appear to be working.

SqlMap:

<insert id="writeOrder" parameterClass="Order"  >
	INSERT INTO
	ORDERS(order_price)
	values(#orderPrice#)
</insert>

Code:

Long id = (Long)client.insert(new SqlMapId("writeOrder"),order);


The returned value is always null. but I want the primary key id.

am I doing anything wrong here (using ibatis 2.0.9.496)  I'm sure when i
tried this on an earlier version if iBatis it was working.

Thanks,
Steve.


Mime
View raw message