hibernate异常,两天了还没解决
异常信息:
net.sf.hibernate.HibernateException: identifier of an instance of **
** altered from *** to ***
hbm.xml:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin 2.1
http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->
<class
name="com.forevoice.hibernate.PbakCallCdr"
table="PBAK_CALL_CDR"
>
<composite-id>
<key-property
name="billid"
column="BILLID"
type="java.lang.Long"
length="22"
/>
<key-property
name="callref"
column="CALLREF"
type="java.lang.Long"
length="22"
/>
<key-property
name="caller"
column="CALLER"
type="java.lang.String"
length="30"
/>
<key-property
name="callee"
column="CALLEE"
type="java.lang.String"
length="30"
/>
<key-property
name="begintime"
column="BEGINTIME"
type="java.sql.Timestamp"
length="11"
/>
<key-property
name="endtime"
column="ENDTIME"
type="java.sql.Timestamp"
length="11"
/>
<key-property
name="service"
column="SERVICE"
type="int"
length="4"
/>
<key-property
name="chgind"
column="CHGIND"
type="int"
length="1"
/>
<key-property
name="cause"
column="CAUSE"
type="int"
length="4"
/>
<key-property
name="subserv"
column="SUBSERV"
type="java.lang.Integer"
length="2"
/>
</composite-id>
<!-- Associations -->
<!-- derived association(s) for compound key -->
<!-- end of derived association(s) -->
</class>
</hibernate-mapping>
bean:
package com.forevoice.hibernate;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang.builder.ToStringBuilder;
/** @author Hibernate CodeGenerator */
public class PbakCallCdr implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
/** identifier field */
private Long billid;
/** identifier field */
private Long callref;
/** identifier field */
private String caller;
/** identifier field */
private String callee;
/** identifier field */
private java.sql.Timestamp begintime;
/** identifier field */
private java.sql.Timestamp endtime;
/** identifier field */
private Integer service;
/** identifier field */
private Integer chgind;
/** identifier field */
private Integer cause;
/** identifier field */
private Integer subserv;
/** full constructor */
public PbakCallCdr(Long billid, Long callref, String caller, String callee, java.sql.Timestamp begintime, java.sql.Timestamp endtime, Integer service, Integer chgind, Integer cause, Integer subserv) {
this.billid = billid;
this.callref = callref;
this.caller = caller;
this.callee = callee;
this.begintime = begintime;
this.endtime = endtime;
this.service = service;
this.chgind = chgind;
this.cause = cause;
this.subserv = subserv;
}
/** default constructor */
public PbakCallCdr() {
}
public Long getBillid() {
return this.billid;
}
public void setBillid(Long billid) {
this.billid = billid;
}
public Long getCallref() {
return this.callref;
}
public void setCallref(Long callref) {
this.callref = callref;
}
public String getCaller() {
return this.caller;
}
public void setCaller(String caller) {
this.caller = caller;
}
public String getCallee() {
return this.callee;
}
public void setCallee(String callee) {
this.callee = callee;
}
public java.sql.Timestamp getBegintime() {
return this.begintime;
}
public void setBegintime(java.sql.Timestamp begintime) {
this.begintime = begintime;
}
public java.sql.Timestamp getEndtime() {
return this.endtime;
}
public void setEndtime(java.sql.Timestamp endtime) {
this.endtime = endtime;
}
public Integer getService() {
return this.service;
}
public void setService(Integer service) {
this.service = service;
}
public Integer getChgind() {
return this.chgind;
}
public void setChgind(Integer chgind) {
this.chgind = chgind;
}
public Integer getCause() {
return this.cause;
}
public void setCause(Integer cause) {
this.cause = cause;
}
public Integer getSubserv() {
return this.subserv;
}
public void setSubserv(Integer subserv) {
this.subserv = subserv;
}
public String toString() {
return new ToStringBuilder(this)
.append("billid", getBillid())
.append("callref", getCallref())
.append("caller", getCaller())
.append("callee", getCallee())
.append("begintime", getBegintime())
.append("endtime", getEndtime())
.append("service", getService())
.append("chgind", getChgind())
.append("cause", getCause())
.append("subserv", getSubserv())
.toString();
}
public boolean equals(Object obj)
{
return false;
}
public int hashCode()
{
return 0;
}
}
两天还没解决,寻求解决办法