Hello.

 I've found bug or not - I don't know. 
 There is id identity column in MSSQL 2000 (8.0) tables. I'd like to get
value for the inserted records and add 

<selectKey resultClass="int" type="post" property="ID"> SELECT @@IDENTITY AS
ID </selectKey> element to the insert statement in the sqlMap configuration
file.

 In runtime for each insert ProbeException was raised : "Cannot widen from
target to primitive type". I've found that propertyValue has "decimal" type
even if resultClass was set to "int" in the selectKey element. To suppress
this exception I add cast @@IDENTITY to the integer type.

<selectKey resultClass="int" type="post" property="ID"> SELECT
cast(@@IDENTITY as integer) AS ID </selectKey>

 Now all works fine. Why iBATIS doesn't convert selectKey result to the
integer type?


--     
 С уважением, Алексей Бородай
 Отдел разработки ПО


___________________________________________________________________________

This communication is confidential and may be legally privileged. 
If you believe you are not an intended recipient, please inform the sender, 
delete the e-mail and do not copy, print or use it or disclose it to others. 
You can inform the sender by replying to this e-mail or by telephone (+380 44 
4906080).


Reply via email to