Reputation: 584
I have following hibernate based XML properties.What i need is to convert following to JPA Annotations
<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>
can anyone help me to convert this code phrase to JPA annotation
Upvotes: 0
Views: 310
Reputation: 1209
As i understand this property is used to generate the sequence that can also done by this annotations.
@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;
Upvotes: 1