0

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

Malinda
  • 524
  • 2
  • 5
  • 11
  • 1
    Have a look [over here](https://stackoverflow.com/questions/31241594/generate-annotated-java-class-from-hbm-file/31243300#31243300). This post shares some links concerning reverse engineering of Hibernate XML. – Felix Seifert Oct 11 '19 at 09:44

1 Answers1

1

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; 
Basharat Ali
  • 1,099
  • 9
  • 11