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