We using MYSQL and Hibernate for our project.
JPA is used to persist object in DB.
We have Multiple class with similar code
@Entity
@Table(n
@Id
@SequenceGenerator(name="admin_seq", sequenceName="unique_id")
@GeneratedValue(strategy=GenerationType.AUTO, generator="admin_seq")
private Long id
worked for me , thanks for all your answers
The AUTO strategy should work on Oracle as well. The difference with MySQL is that it will use a sequence instead of relying on an auto_increment ID.
You can even control the sequence name per entity if desired: see Hibernate sequence on oracle, @GeneratedValue(strategy = GenerationType.AUTO).