0
@Entity
@Table(name = "RateTransmissionDetails")
public class RateTransmissionDetails implements java.io.Serializable {
private String spaceNum;
private Integer rateInCent;
public RateTransmissionDetails() {
}
public RateTransmissionDetails(String spaceNum,Integer rateInCent) {
this.spaceNum=spaceNum;
this.rateInCent=rateInCent;
}
@Column(name = "SpaceNum", nullable = false)
public String getSpaceNum() {
return this.spaceNum;
}
public void setSpaceNum(String spaceNum) {
this.spaceNum = spaceNum;
}
@Column(name = "RateInCent", nullable = false)
public Integer getRateInCent() {
return this.rateInCent;
}
public void setRateInCent(Integer rateInCent) {
this.rateInCent = rateInCent;
}
,我的服務類是不能被轉換爲java.lang.String異常
Set<RateTransmissionDetails> rateTrmDtls = new HashSet<RateTransmissionDetails>();
rateTrmDtls.add((new RateTransmissionDetails("A",new Integer(20)));
我收到錯誤
2012年11月2日16:44:02796 [ http-6060-3] WARN duncansolutions.databus.external.controller.rate.RateController - 錯誤消息給調用者:com.duncansolutions.databus.external.bean.hibernate.rate.RateTransmissionDetails不能轉換爲java.lang.String
任何人都可以告訴我如何去做。
你應該發佈所有的服務類代碼,以找出錯誤發生的地方,如果這是你的所有堆棧跟蹤 – wxyz