0

Now the generator goes sequentially with step 1.

I need the ID to generate its own function.

How to substitute its function?

Thank you.

@Entity
@Table(name = "MovementHistory")
public class MovementHistory {
    @Id
    @SequenceGenerator(name="SEQ_GEN_MH", sequenceName="SEQ_MH", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="SEQ_GEN_MH")
    private long id;
    private long waybillID;
    private Date dateEvent;
    @ManyToOne(fetch = FetchType.EAGER)
    private Status status;
}
Denis
  • 43
  • 2
  • 7
  • Possible duplicate of https://stackoverflow.com/questions/11631800/hibernate-how-specify-custom-sequence-generator-class-name-using-annotations – ailveen Sep 15 '17 at 06:16
  • Possible duplicate of [Hibernate: How specify custom sequence generator class name using annotations?](https://stackoverflow.com/questions/11631800/hibernate-how-specify-custom-sequence-generator-class-name-using-annotations) – ailveen Sep 15 '17 at 14:58

0 Answers0