title: java.lang.IllegalArgumentException with java persistance API
body: <p>I am getting a <code>java.lang.IllegalArgumentException</code> similar to the link given below.To solve it I tried to change the field type from Integer to Long. But still I am getting:</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: Parameter value [5] was not matching type [com.buddhiedge.server.entity.StudyplanCategory]
  </code></pre>
  
  <p>StudyplanCategory is the entity class.</p>
  
  <p>The problem is similar to the one in the below link.
  <a href="https://stackoverflow.com/questions/6622882/hibernate-parameter-value-2011-was-not-matching-type-java-lang-integer-ho">Hibernate - Parameter value [2011] was not matching type [java.lang.Integer]. How to solve?</a>
  My entity Class is:</p>
  
  <pre><code>@JsonIgnoreProperties({ "studyplanCategoryList", "dropboxzipfile",
          "parentCategory", "createdDate", "updatedDate" })
  @JsonPropertyOrder({ "id", "name", "status", "sptTutorialsList" })
  @Entity
  @Table(name = "studyplan_category", catalog = "buddhiedgeserver_db", schema = "", uniqueConstraints = { @UniqueConstraint(columnNames = { "dropboxzipfile" }) })
  @NamedQueries({
  
          @NamedQuery(name = "StudyplanCategory.findSubStudyPlanById", query = "SELECT s FROM StudyplanCategory s WHERE s.parentCategory=:parentCategory order by updatedDate DESC")})
  
      public class StudyplanCategory implements Serializable {
          private static final long serialVersionUID = 1L;
          @Id
          @GeneratedValue(strategy = GenerationType.IDENTITY)
          @Basic(optional = false)
          @NotNull
          @Column(name = "id", nullable = false)
          private Long id;
  
      }
  </code></pre>