-->
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: SQL Server2005 creats its own Primary Key...how to map?
PostPosted: Thu Dec 15, 2005 7:54 am 
Newbie

Joined: Wed Sep 28, 2005 5:05 am
Posts: 11
Hi at all,
my Subject gives nearly all informations.
I am using Hibernate 2 and SQL Server 2005.
I wanne map an existing Database wich create its own Primary key. If it wouldnt, i could use

<id
name="Id"
type="integer"
column="__Org_RecordNo"
unsaved-value="0"
>
<generator class="identity"/>

to create the key by the mapping file. But in the given situation it doesn´t work. i´m using eclipse 3.1 and everytime when i want to record i get the message:

net.sf.hibernate.exception.GenericJDBCException: could not insert: [de.consistec.Ansprech_Partner.Adressen]

....
....
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The statement must be executed before the generated keys are available

Can anybody help me?

Greetings from Protonis


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.