i have situation on which i try to persist entity with id that depends on the max id value, for example the new entity id will be MAX(id)+1. now i try to use JPA to persist this entity
@Entity
@Table(name = "product")
public class ProductDetails {
@Id
@GeneratedValue
private String id;
i used strategy = GenerationType.AUTO
, strategy = GenerationType.IDENTITY
,strategy = GenerationType.SEQUENCE
,strategy = GenerationType.TABLE
none of them work, so i think i can solve it through selecting the max id then +1 and use that value (i did not try it) what i am asking for, is there is any way to handle this situation through JPA or Hibernate.Note:the id columns is not auto-increment and the db doesn't have sequence.