I am about learning JPA, and I want to know how can we tel the entity manager that the primary key field is generated using the database auto increment to the table? I am using Mysql 5.5 and Oracle Enterprise For Eclipse(OEFE) thanks for help
If you have a a id which needs to be auto incremented then ,
@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With