我有以下基于 hibernate 的 XML 屬性。我需要的是將以下內(nèi)容轉(zhuǎn)換為 JPA 注釋 <id column="PARTNER_PROPERTY_ID" name="id" unsaved-value="0"> <generator class="sequence"> <param name="sequence">CRICKET_TEST_SEQ</param> <param name="parameters">INCREMENT BY 1 START WITH 200</param> </generator> </id>誰能幫我將此代碼短語轉(zhuǎn)換為 JPA 注釋
1 回答

忽然笑
TA貢獻(xiàn)1806條經(jīng)驗(yàn) 獲得超5個(gè)贊
據(jù)我了解,此屬性用于生成也可以通過此注釋完成的序列。
@Id
@SequenceGenerator(name="att_id", sequenceName="attendee_setup_id_seq", initialValue = 1, allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="att_id")
@Column(name="PARTNER_PROPERTY_ID")
private int PARTNER_PROPERTY_ID;
添加回答
舉報(bào)
0/150
提交
取消