title: How to use @Id with String Type in JPA / Hibernate?
body: <p>I have one entity which contains primary key of type string. This entity model is as follows:</p>
  
  <pre><code>@Entity
  public class MyEntity {
  
  @Id
  @Column(name="PR_KEY", unique=true)
  private String prKey;
  
  ....
  ....
  
  }
  </code></pre>
  
  <p>But I am facing issue saying TypeMismatch.</p>
  
  <pre><code>org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.String, got class java.lang.Long
  </code></pre>