create table t_foo(
t_id int primary key,
t_value varchar2(50) not null
);
create sequence t_foo_0
increment by 1
start with 1
nomaxvalue
nominvalue
nocache
create or replace trigger t_foo_t
before insert on t_foo
for each row
begin
select t_foo_0.nextval into:new.t_id from dual;
end;
使用:
insert into t_foo(t_value) values('test');
----------test代码
TFoo tfoo = new TFoo();
tfoo.setTValue("foo100");
Session session = HibernateUtils.openSession();
Transaction ts = session.getTransaction();
ts.begin();
session.save(tfoo);
ts.commit();
session.close();
刚刚申请的号,求各位大神帮忙,不胜感激