Already read lots of questions about the same issue, but I still not be able to solve this problem.
I need to have a String
primary key on my database.
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class MyClass {
@Id
private String myId;
private String name;
// getters and setters..
}
The problem is that, if I use String
type in a @Id
annotated field, Hibernate throws an exception when I try to save the object.
ids for this class must be manually assigned before calling