I'm pretty new to JavaEE technology. Hopefully, you guys can help me out with this issue that I'm facing.
I have a table created, which inside it there's a column "id" which is a primary key field and the key will be auto generated by default. On the other hand. I've a Entity class, where the persistence provider will auto include every field to database. My question is, how can I prevent this from happening?
By the way, I've tried using @Column(insertable=false). This doesn't seems working though.
Same error on the class file as well. Do I really need the @GeneratedValue(strategy=GenerationType.IDENTITY) . Since in this case, my database will automatically generate the value for me, instead of the persistence provider?
I read from the Java API docs, it says that if we have @Column(insertable=false) , the persistence provider will ignore this column for the insert statement. But for me it is not happening, every time it still insert to the column, which at the end will throw error, because of having the same primary key.