【发布时间】:2015-10-12 13:46:21
【问题描述】:
这是我的实体类:
@Entity
@Table(name = "courier_upload_queue")
public class CourierUploadQueue {
private int id;
private String crp_code;
private Status status;
private Date time_created;
private Date last_update;
private String courier_name;
private Integer retry_count;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", unique = true, nullable = false)
public Integer getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
@Enumerated(EnumType.STRING)
@Column(name= "status", nullable= false)
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
@Column(name= "crp_code", unique = true, nullable = false)
public String getCrp_code() {
return crp_code;
}
public void setCrp_code(String crp_code) {
this.crp_code = crp_code;
}
@Column(name="time_created", nullable = false)
public Date getTime_created() {
return time_created;
}
public void setTime_created(Date time_created) {
this.time_created = time_created;
}
@Column(name="last_update", nullable = false)
public Date getLast_update() {
return last_update;
}
public void setLast_update(Date last_update) {
this.last_update = last_update;
}
@Column(name="courier_name", nullable = false)
public String getCourier_name() {
return courier_name;
}
public void setCourier_name(String courier_name) {
this.courier_name = courier_name;
}
@Column(name="retry_count", nullable = false)
public Integer getRetry_count() {
return retry_count;
}
public void setRetry_count(Integer retry_count) {
this.retry_count = retry_count;
}
}
这是我的 DaoImpl
@Override
public void insertToCourierUploadQueue(String crp_code, String courier_name)
{
Query query = sessionFactory.getCurrentSession().createQuery("insert into CourierUploadQueue (:crp_code, 'PENDING', CURRENT_TIMESTAMP() , CURRENT_TIMESTAMP() , :courier_name, 0 )");
query.setParameter("crp_code", crp_code);
query.setParameter("courier_name", courier_name.toLowerCase());
query.executeUpdate();
}
我已经在我的数据库中创建了相应的表。
我收到错误消息:
无法解析属性::com.pooja.entity.CourierUploadQueue
你们能帮我解决这个问题吗?
【问题讨论】:
-
它为哪个属性投掷?
-
你能分享完整的堆栈跟踪吗?