hibernate id生成器配置

时间:2022-01-23 15:40:57

1.uuid配置

<id name="tomdId" type="java.lang.String">
  <column name="TOMD_ID" length="32" />
  <generator class="uuid" />
</id>

2.Oracle序列配置

<id name="adId" type="java.lang.Long">
  <column name="AD_ID" precision="11" scale="0" />
  <generator class="sequence">
    <param name="sequence">SEQ_MS_ADVERTISING_ID</param>
  </generator>
</id>