@SequenceGenerator(name = "SEQ_HRMS_EMP", sequenceName = "SEQ_HRMS_EMP", initialValue = 1, allocationSize = 1)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_HRMS_EMP")
@Id
@Column(name = "user_id")
private Integer userId;
Schema export from hibernate
- MySql
create table HRMS_EMP (
user_id integer not null auto_increment,
MySql will ignore the generator = "SEQ_HRMS_EMP" setting because MySql does not have sequence. - Postgres
create sequence SEQ_HRMS_EMP; - Oracle
create sequence SEQ_HRMS_EMP;
No comments:
Post a Comment