DBから値をフェッチしようとしています。休止状態を正常に構成しました。以下は私のhbmファイルとpojoクラスです。
<class name="UserMasterBean" table="EMPLOYEE_MASTER">
<id name="Id" type="long">
<column name="EMP_ID" length="10" />
<generator class="assigned" />
</id>
<property name="FirstName" type="string">
<column name="EMP_FIRST_NAME" length="30" not-null="true" />
</property>
<property name="SecondName" type="string">
<column name="EMP_SECOND_NAME" length="30" />
</property>
<property name="LastName" type="string">
<column name="EMP_LAST_NAME" length="30" />
</property>
<property name="empDob" type="date">
<column name="EMP_DOB" length="7" not-null="true" />
</property>
<property name="empDoj" type="date">
<column name="EMP_DOJ" length="7" not-null="true" />
</property>
<property name="empPermAdd1" type="string">
<column name="EMP_PERM_ADD1" length="50" not-null="true" />
</property>
<!--Other Properties removed-->
以下は私のpojoクラスです
public class UserMasterBean {
private Long id;
private String loginName;
private String password;
private String type;
private String loginYN;
private String salutation;
private String firstName;
private String secondName;
private String lastName;
private String gender;
private String maritalStatus;
private String pagerNo;
private String phoneNo;
private String mobileNo;
private String emailId;
private String personalMailId;
private Long companyId;
private String companyName;
private Long worldWideRegion;
private Long country;
private Long localRegion;
private Long state;
private Long city;
private Long department;
private String curriculum;
private String dn;
private String photoPath;
private java.sql.Timestamp empDob;
private java.sql.Timestamp empDoj;
private java.sql.Timestamp empDol;
private java.sql.Timestamp empDoc;
private String empPanNo;
private String empBloodGroup;
private String empCurrcBand;
private String empPassportNo;
private String empManager;
public String getFieldPrefix() {
return fieldPrefix;
}
public Long getId() {
return id;
}
public String getLoginName() {
return loginName;
}
public String getPassword() {
return password;
}
public String getType() {
return type;
}
public String getLoginYN() {
return loginYN;
}
public String getSalutation() {
return salutation;
}
public String getFirstName() {
return firstName;
}
public String getSecondName() {
return secondName;
}
public String getLastName() {
return lastName;
}
/* Amit Gupte - Modified - IUser Begin */
public String getMiddleName() {
return secondName;
}
public String getName() {
return firstName + " " + lastName;
}
/* Amit Gupte - Modified - IUser End*/
public String getGender() {
return gender;
}
public String getMaritalStatus() {
return maritalStatus;
}
public String getPagerNo() {
return pagerNo;
}
public String getPhoneNo() {
return phoneNo;
}
public String getMobileNo() {
return mobileNo;
}
public String getEmailId() {
return emailId;
}
public String getPersonalMailId() {
return personalMailId;
}
public Long getCompanyId() {
return companyId;
}
public String getCompanyName() {
return companyName;
}
public Long getWorldWideRegion() {
return worldWideRegion;
}
public Long getCountry() {
return country;
}
public Long getLocalRegion() {
return localRegion;
}
public Long getState() {
return state;
}
public Long getCity() {
return city;
}
public Long getDepartment() {
return department;
}
public String getCurriculum() {
return curriculum;
}
public String getDn() {
return dn;
}
public String getPhotoPath() {
return photoPath;
}
public java.sql.Timestamp getEmpDob() {
return empDob;
}
public java.sql.Timestamp getEmpDoj() {
return empDoj;
}
public java.sql.Timestamp getEmpDol() {
return empDol;
}
public java.sql.Timestamp getEmpDoc() {
return empDoc;
}
public String getEmpPanNo() {
return empPanNo;
}
public String getEmpBloodGroup() {
return empBloodGroup;
}
public String getEmpCurrcBand() {
return empCurrcBand;
}
public String getEmpPassportNo() {
return empPassportNo;
}
public String getEmpManager() {
return empManager;
}
//Other methods removed
}
以下のエラーに直面しています。
Sep 04, 2013 11:50:19 AM org.hibernate.type.NullableType nullSafeGet
INFO: could not read column value from result set: EMP1_0_; Fail to convert to internal representation
Sep 04, 2013 11:50:19 AM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 17059, SQLState: 99999
Sep 04, 2013 11:50:19 AM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Fail to convert to internal representation
コードの何が問題なのかわかりません。
私は次のようにクエリします
String hql = "from UserMasterBean";
List empList = attendance.getList(hql, factory);
他のクラスの場合、その作業