配置文件:
<hibernate-mapping>
<class name="MonthTemp" table="MONTH_TEMP" >
<id name="id" type="long">
<column name="ID" />
<generator class="assigned" >
</generator>
</id>
<property name="visittime" type="timestamp">
<column name="VISITTIME" length="7" />
</property>
......
</class>
</hibernate-mapping>创建的序列和触发器:
create sequence seq_month_temp;create or replace trigger trigger_month_temp
before insert on month_temp For each row
begin
select seq_month_temp.nextval into :new.id from dual;
end;
<hibernate-mapping>
<class name="MonthTemp" table="MONTH_TEMP" >
<id name="id" type="long">
<column name="ID" />
<generator class="assigned" >
</generator>
</id>
<property name="visittime" type="timestamp">
<column name="VISITTIME" length="7" />
</property>
......
</class>
</hibernate-mapping>创建的序列和触发器:
create sequence seq_month_temp;create or replace trigger trigger_month_temp
before insert on month_temp For each row
begin
select seq_month_temp.nextval into :new.id from dual;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货