-->
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: Create Sequence
PostPosted: Fri Jul 02, 2010 9:52 am 
Newbie

Joined: Tue Jul 29, 2008 7:01 am
Posts: 9
Why for the following is the 'create table' command generated before the 'create sequence' command.

To me this kind of renders the construct useless as the create table statement obviously fails as the referenced sequence does not exist.

Code:
@Entity
@Table(name = "patterns")
public class Pattern
{
   @Id
   @Column(name = "pattern_id", columnDefinition = "integer default nextval('pattern_id_sequence')")
   @SequenceGenerator(name="sequenceIDGenerator", sequenceName="pattern_id_sequence")
   @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="sequenceIDGenerator")
   private int patternId;
}


Thanks.

Alan


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.