JPA 物件〈CDR_Info〉
package com.emprogria;
import com.emprogria.jpa.CdrInfoPK;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
@Table(name = "cdr_info")
@NamedQueries({
@NamedQuery(name = "CdrInfo.findAll", query = "SELECT c FROM CdrInfo c"),
@NamedQuery(name = "CdrInfo.findByFileName", query = "SELECT c FROM CdrInfo c WHERE c.cdrInfoPK.fileName = :fileName"),
@NamedQuery(name = "CdrInfo.findByRecordNumber", query = "SELECT c FROM CdrInfo c WHERE c.cdrInfoPK.recordNumber = :recordNumber"),
@NamedQuery(name = "CdrInfo.findByEntryTime", query = "SELECT c FROM CdrInfo c WHERE c.entryTime = :entryTime")})
public class CdrInfo implements Serializable {
private static final long serialVersionUID = 1L;
@EmbeddedId
protected CdrInfoPK cdrInfoPK;
@Lob
@Column(name = "record_data")
private String recordData;
@Basic(optional = false)
@Column(name = "entry_time")
@Temporal(TemporalType.TIMESTAMP)
private Date entryTime;
public CdrInfo() {
}
public CdrInfo(CdrInfoPK cdrInfoPK) {
this.cdrInfoPK = cdrInfoPK;
}
public CdrInfo(CdrInfoPK cdrInfoPK, Date entryTime) {
this.cdrInfoPK = cdrInfoPK;
this.entryTime = entryTime;
}
public CdrInfo(String fileName, int recordNumber) {
this.cdrInfoPK = new CdrInfoPK(fileName, recordNumber);
}
public CdrInfoPK getCdrInfoPK() {
return cdrInfoPK;
}
public void setCdrInfoPK(CdrInfoPK cdrInfoPK) {
this.cdrInfoPK = cdrInfoPK;
}
public String getRecordData() {
return recordData;
}
public void setRecordData(String recordData) {
this.recordData = recordData;
}
public Date getEntryTime() {
return entryTime;
}
public void setEntryTime(Date entryTime) {
this.entryTime = entryTime;
}
@Override
public int hashCode() {
int hash = 0;
hash += (cdrInfoPK != null ? cdrInfoPK.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof CdrInfo)) {
return false;
}
CdrInfo other = (CdrInfo) object;
if ((this.cdrInfoPK == null && other.cdrInfoPK != null) || (this.cdrInfoPK != null && !this.cdrInfoPK.equals(other.cdrInfoPK))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.emprogria.CdrInfo[cdrInfoPK=" + cdrInfoPK + "]";
}
}