-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How insert row in table with INSTEAD OF TRIGGER on it?
PostPosted: Wed Aug 31, 2005 5:06 am 
Newbie

Joined: Thu Aug 25, 2005 3:14 am
Posts: 19
Hi !

I working with MSSQL Server 2000 and have table with column Id as IDENTITY, and with INSTEAD OF INSERT trigger on this table. In class mapping file i mapped
Code:
      <id name="Id" column="Id" unsaved-value="-1">
         <generator class="identity" />
      </id>


when i save class in table Hibernate throw ADOException "Could not save object"
I think this excepion occured when after inserting row in table, HNIbernate trying to get Id of new row with query
Code:
SELECT SCOPE_IDENTITY()

and it return NULL as a really insert occurred in instead of trigger.

help pls. resolve this problem.

_________________
------------------------------
NETDigitally yours Jericho


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.