Archa
Archa
JCHJava Community | Help. Code. Learn.
Created by Archa on 10/1/2024 in #java-help
JPA When Primary Key Not Id
Is it possible to avoid check entry without using @GeneratedValue I want put the entry @id and force to insert new entry without checking duplicate entry even it will throw error
23 replies
JCHJava Community | Help. Code. Learn.
Created by Archa on 10/1/2024 in #java-help
JPA When Primary Key Not Id
If i want use @GeneratedValue the parameter have to auto increment?
23 replies
JCHJava Community | Help. Code. Learn.
Created by Archa on 10/1/2024 in #java-help
JPA When Primary Key Not Id
When i use this entity and then using jpa for insert data into database using function save() my service take a long time, when i trace it when function save() execute query insert it will execute query select first
23 replies
JCHJava Community | Help. Code. Learn.
Created by Archa on 10/1/2024 in #java-help
JPA When Primary Key Not Id
when using function save() is it gonna select all data to checking if my primary key duplicate or not first before execute save()?
23 replies
JCHJava Community | Help. Code. Learn.
Created by Archa on 10/1/2024 in #java-help
JPA When Primary Key Not Id
Is it not good if i use String reff instead Long id?
23 replies
JCHJava Community | Help. Code. Learn.
Created by Archa on 10/1/2024 in #java-help
JPA When Primary Key Not Id
But this is how i use
@Id
@Column(name = "reference_number")
private String reff;
@Id
@Column(name = "reference_number")
private String reff;
23 replies
JCHJava Community | Help. Code. Learn.
Created by Archa on 10/1/2024 in #java-help
JPA When Primary Key Not Id
Usually i found tutorial used like this
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
23 replies
JCHJava Community | Help. Code. Learn.
Created by Archa on 10/1/2024 in #java-help
JPA When Primary Key Not Id
Sorry i mean not annotation Id but parameter id(int; auto increment)
23 replies