Error creating bean with name 'produceDao': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Produce is not mapped [update Produce a set a.clickNum
= a.clickNum+1 where a.id = ?1 ]
@Entity
@Table(name = "t_produce")public class Produce implements Serializable {
private static final long serialVersionUID = 1L;
public Produce(){
super();
}
}
Dao层必须使用:
@Modifying
@Query("update Produce a set a.clickNum = a.clickNum+1 where a.id = ?1 ")
public void updateClickNum(int id);
@Entity(name = "t_produce")
public class Produce implements Serializable {
private static final long serialVersionUID = 1L;
public Produce(){
super();
}
}
Dao层必须使用:
@Modifying
@Query("update t_produce a set a.clickNum = a.clickNum+1 where a.id = ?1 ")
public void updateClickNum(int id);