-->
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: Wrong DDL with new generators and AUTO strategy ?
PostPosted: Thu Oct 13, 2011 12:19 pm 
Beginner
Beginner

Joined: Mon Jan 10, 2005 7:14 am
Posts: 32
Hi,

I encounter problems with id columns in DDL generated with hbm2ddl tool for JPA entities having ids generated with AUTO strategy.

I have the following entity :

Code:
@Entity
public class Person {

   @Id
   @GeneratedValue(strategy=GenerationType.AUTO)
   private Long id;
   
}


If i set hibernate.id.new_generator_mappings property to true (which is recommended in the user documentation for new projects), the DDL generated for SQL Server looks wrong since the "id" columns is not an IDENTITY one. Instead it generates a "hibernate_sequence" table. Same kind of problem with MySQL.

If I set hibernate.id.new_generator_mappings property to false the id column is an IDENTITY one so the DDL is OK.

Maybe I misunderstood something ?

Thanks for your help !

Olivier


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.