How to override @SequenceGenerator(name = “idGenerator”, sequenceName = “HIBERNATE_SEQUENCE”, allocationSize = 50)
问题 Normally Id column is as follows and it works perfectly fine and generated sequence values @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idGenerator") @SequenceGenerator(name = "idGenerator", sequenceName = "HIBERNATE_SEQUENCE", allocationSize = 50) @Column(name = "ID") public Long getId() { return mId; } Now what I want is if in program I set xyz.setId(200) it should save Id as 200 instead of one generated by sequence.Now how can I acheive this? I also want to use both