-->
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.  [ 3 posts ] 
Author Message
 Post subject: generatedvalue in ms-sql
PostPosted: Sat Jul 29, 2006 8:59 am 
Newbie

Joined: Wed Mar 08, 2006 8:11 am
Posts: 17
Location: Israel
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.2 rc2

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using: sqlsever 2005 express

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


I am just having some problems with generating the ids - is there no "auto" generation in ms-sql? should I create a sequence on the db, and use it instead? is there a way to craete such a sequence using only annotations in the class, or should I create it before-hand on the db?

Thanks for the info.


Top
 Profile  
 
 Post subject: solution?
PostPosted: Sat Jul 29, 2006 12:01 pm 
Newbie

Joined: Wed Mar 08, 2006 8:11 am
Posts: 17
Location: Israel
well, I just changed the annotation to

@GeneratedValue(strategy = GenerationType.IDENTITY)

and it works alright, as far as I can tell.
Thanks anyway.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 1:08 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
AUTO works on SQLServer

_________________
Emmanuel


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

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.