Issue
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
Solution
If you have an identifier called id
which needs to be auto incremented then:
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
Answered By - vikiiii
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.