我得到了java.lang.IllegalArgumentException
类似于下面给出的链接。为了解决它,我尝试将字段类型从整数更改为长。但我仍然得到:
Caused by: java.lang.IllegalArgumentException: Parameter value [5] was not matching type [com.buddhiedge.server.entity.StudyplanCategory]
StudyplanCategory 是实体类。
该问题类似于以下链接中的问题。 Hibernate - 参数值 [2011] 与类型 [java.lang.Integer] 不匹配。怎么解决? 我的实体类是:
@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;
}