Java Community | Help. Code. Learn.JC|HCL
Java Community | Help. Code. Learn.โ€ข16mo agoโ€ข
22 replies
Archa

JPA When Primary Key Not Id

I'm new using spring and jpa, i notice when my primary key is not
id
is gonna effect performance and take more time for process when i try save/insert data, is it just my conclusion but is it true when primay key is not
id
(reference_numbervarchar) gonna doing select all data for checking if primary key already exist or not?
I hope i could still using reference_number as primary key and prevent jpa to select all data and just try insert data and throw error when primary key exist
Was this page helpful?