0

I'm trying to create a simple table using ebean in playframework 2.1.1 with postgresql:

@Entity

@Table(name = "user")

public class User extends Model {

    @Id     
    public long id;

    @Column(name = "email")
    public String email;
}

The Ebean DDL actually create the following:

create table user (

  id                        bigint not null,

  email             varchar(255),

  constraint pk_user primary key (id));

create sequence user_seq;
  1. Why isn't ebean using serial/bigserial?

  2. Is there a different way creating the table with serial/bigserial (I tried using other options that I checked and none of them worked)

  3. If using a sequence (ex: user_seq) is the correct way (or rather the only way), why aren't them sequential - for example: inserted data and got id 300-350 and then 365 and then 366.. No other user is connected, this behavior was repetitive (after few inserts).

thanks:)

4

0 回答 0