I have one entity which contains primary key of type string. This entity model is as follows:
@Entity
public class MyEntity {
@Id
@Column(name="PR_KEY", unique=true)
private String prKey;
....
....
}
But I am facing issue saying TypeMismatch.
org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.String, got class java.lang.Long
getPrKey()
? are you sure that it's returning aString
object? – Retrace