-2
Bu garip özel durumu DataBase'den geri almaya çalışırken alıyorum. Bu, pojo sınıfına getirdiği verileri dönüştüremediğini anlıyorum ama neden ve yığın izinin herhangi bir şey vermediğini anlamıyorum gösterge. Pojo sınıf İşte Hazırda bekletme durumu 4
package en.vod.beans;
import java.sql.Clob;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "table_fault")
public class casedetails {
@Column(name = "title")
private String title;
@Id
@Column(name = "number")
private String fasoid;
@Column(name = "case_type_lvl1")
private String language;
@Column(name = "case_history")
private Clob casehistory;
@Column(name = "fault_status")
private String work_function;
@Column(name = "fault_id")
private String lid ;
@Column(name = "customer_responsible_group")
private String newMail ;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getFasoid() {
return fasoid;
}
public void setFasoid(String fasoid) {
this.fasoid = fasoid;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public Clob getCasehistory() {
return casehistory;
}
public void setCasehistory(Clob casehistory) {
this.casehistory = casehistory;
}
public String getWork_function() {
return work_function;
}
public void setWork_function(String work_function) {
this.work_function = work_function;
}
public String getLid() {
return lid;
}
public void setLid(String lid) {
this.lid = lid;
}
public String getNewMail() {
return newMail;
}
public void setNewMail(String newMail) {
this.newMail = newMail;
}
}
public static casedetails read(String companyID) {
casedetails detilsfaso = new casedetails();
Session session = BaseDao.getSessionFactory();
detilsfaso = (casedetails) session.createQuery("Select title,fasoid,language,casehistory,work_function,lid,newMail FROM casedetails where fasoid = '" + companyID + "'");
session.close();
return detilsfaso;
}
hata Bir ClassCastException var
[org.jboss.as.webservices.invocation.InvocationHandlerJAXWS] (http-//localhost:8080-5) JBAS015594: Method invocation failed with exception: [Ljava.lang.Object; cannot be cast to en.vod.beans.casedetails: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to en.vod.beans.casedetails
Şunun gibi bir şey deneyin: ... createQuery ("select c FROM casedetails c ....). GetSingleResult() –