1 Oracle执行
create sequence menu_autoinc_seqs
minvalue 1maxvalue 99999999
start with 1
increment by 1
nocycle
nocache
order;
create or replace trigger menu_autoinc_tg
before insert on IDENTIFY for each row
begin
select menu_autoinc_seqs.nextval into :new .lid from dual;
end menu_autoinc_tg;
2 Hibernate注解标识
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="menu_autoinc_seqs")
@SequenceGenerator(name="menu_autoinc_seqs",sequenceName="menu_autoinc_seqs")
private String cid;