Created
March 2, 2017 06:35
-
-
Save gokman/25f1cc779d551f057bf326e99420477d to your computer and use it in GitHub Desktop.
spring jpa - generated non-primary value become zero when update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //to accomplish this problem we need to add "updatable=false" to that column | |
| //because without this definition when we need update a row automatically hibernate assign default value 0 (zero) | |
| @Basic | |
| @GeneratedValue | |
| @Column(name = "id", insertable = false, updatable = false) | |
| public long getId() { | |
| return id; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment