-->
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.  [ 2 posts ] 
Author Message
 Post subject: auto increment as expected?
PostPosted: Thu Aug 10, 2006 1:53 am 
Beginner
Beginner

Joined: Wed May 10, 2006 9:43 pm
Posts: 30
Location: Australia
Hi everyone,

I have a question about the auto increment. I have the following mapping file that does not display auto_increment when viewing the table schema (i.e. using describe "table name"). I'm using mysql. When created using sql it is displayed within the extra column for the field.

Code:
<id name="id" type="long" column="ID">
      <generator class="increment"/>
</id>


I assumed increment would work this way. If I have misunderstood or you can help to working correctly please post a response.

Thanks, Alyssa.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 10, 2006 3:10 am 
Newbie

Joined: Wed Aug 09, 2006 1:43 pm
Posts: 4
Location: Austria
I am new to hibernate but, i think you should use:

Code:
<id name="id" type="long" column="ID">
      <generator class="native"/>
</id>


So it will use the feature of the database.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.