看下图错误:
你所执行的SQL语句呢?有可能是你写错了,或者是接收出错了。
你确认一下,类名与语句是否一致。
ApDoctor类以及ApDoctorDao接口贴出来
贴出来了,看看是啥问题
------------------------ApDoctor 类----------------------------------------------------------------
package com.gx.xxm.user.model;
import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import com.gx.xxm.user.model.ApDoctortype;
import com.gx.xxm.user.model.ApAnaesthesiaroom;
/**
@SuppressWarnings("serial")
public class ApDoctor implements java.io.Serializable {
// Fields
private Integer doctorId;
private Integer doctorTypeId;
private Integer anaesthesiaRoomId;
private String doctorNumber;
private String doctorName;
private String password;
private String doctorPhoto;
private String doctorAge;
private String doctorSex;
private String contactPhone;
private String email;
private String contactAddress;
private Timestamp birthday;
private Timestamp workDate;
private String remark;
//多对一 一个医生类型对多个医生
private ApDoctortype apDoctortype;
//多对多 多个医生对多个麻醉室
private ApAnaesthesiaroom anaesthesiaRoom;
private Set<ApPatient> patients = new HashSet<ApPatient>();
// Constructors
/** default constructor */
public ApDoctor() {
}
/** full constructor */
public ApDoctor(Integer doctorTypeId, Integer anaesthesiaRoomId,
String doctorNumber, String doctorName, String password, String doctorPhoto,
String doctorAge, String doctorSex, String contactPhone,
String email, String contactAddress, Timestamp birthday,
Timestamp workDate, String remark) {
this.doctorTypeId = doctorTypeId;
this.anaesthesiaRoomId = anaesthesiaRoomId;
this.doctorNumber = doctorNumber;
this.doctorName = doctorName;
this.password = password;
this.doctorPhoto = doctorPhoto;
this.doctorAge = doctorAge;
this.doctorSex = doctorSex;
this.contactPhone = contactPhone;
this.email = email;
this.contactAddress = contactAddress;
this.birthday = birthday;
this.workDate = workDate;
this.remark = remark;
}
// Property accessors
public Integer getDoctorId() {
return this.doctorId;
}
public void setDoctorId(Integer doctorId) {
this.doctorId = doctorId;
}
public Integer getDoctorTypeId() {
return this.doctorTypeId;
}
public void setDoctorTypeId(Integer doctorTypeId) {
this.doctorTypeId = doctorTypeId;
}
public Integer getAnaesthesiaRoomId() {
return this.anaesthesiaRoomId;
}
public void setAnaesthesiaRoomId(Integer anaesthesiaRoomId) {
this.anaesthesiaRoomId = anaesthesiaRoomId;
}
public String getDoctorNumber() {
return this.doctorNumber;
}
public void setDoctorNumber(String doctorNumber) {
this.doctorNumber = doctorNumber;
}
public String getDoctorName() {
return this.doctorName;
}
public void setDoctorName(String doctorName) {
this.doctorName = doctorName;
}
public String getDoctorPhoto() {
return this.doctorPhoto;
}
public void setDoctorPhoto(String doctorPhoto) {
this.doctorPhoto = doctorPhoto;
}
public String getDoctorAge() {
return this.doctorAge;
}
public void setDoctorAge(String doctorAge) {
this.doctorAge = doctorAge;
}
public String getDoctorSex() {
return this.doctorSex;
}
public void setDoctorSex(String doctorSex) {
this.doctorSex = doctorSex;
}
public String getContactPhone() {
return this.contactPhone;
}
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public String getContactAddress() {
return this.contactAddress;
}
public void setContactAddress(String contactAddress) {
this.contactAddress = contactAddress;
}
public Timestamp getBirthday() {
return this.birthday;
}
public void setBirthday(Timestamp birthday) {
this.birthday = birthday;
}
public Timestamp getWorkDate() {
return this.workDate;
}
public void setWorkDate(Timestamp workDate) {
this.workDate = workDate;
}
public String getRemark() {
return this.remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public ApDoctortype getApDoctortype() {
return apDoctortype;
}
public void setApDoctortype(ApDoctortype apDoctortype) {
this.apDoctortype = apDoctortype;
}
public ApAnaesthesiaroom getAnaesthesiaRoom() {
return anaesthesiaRoom;
}
public void setAnaesthesiaRoom(ApAnaesthesiaroom anaesthesiaRoom) {
this.anaesthesiaRoom = anaesthesiaRoom;
}
public Set<ApPatient> getPatients() {
return patients;
}
public void setPatients(Set<ApPatient> patients) {
this.patients = patients;
}
}
----------------------------------------结束-----------------------------------------------
-----------------------------ApDoctorDao 接口 ------------------------------------------
@Repository(value = "apDoctorDao")
public class ApDoctorDao extends HibernateDaoSupport {
@Resource(name = "sessionFactory")
public void setSuerSessionFactory(SessionFactory sessionFactory) {
super.setSessionFactory(sessionFactory);
}
/**
* 修改-----医生信息
* @param hql
* @param docs
*/
public void updateDoctor(String hql, Object[] docs) {
this.getHibernateTemplate().update(hql, docs);
}
}
--------------------结束---------------------------------------
貌似我看你修改语句里边把主键都修改了,都不是一个对象了,所以会报unknown entity