/* ================================================================== * Created [2009-4-27 下午11:32:55] by Jon.King * ================================================================== * TSS * ================================================================== * mailTo:jinpujun@hotmail.com * Copyright (c) Jon.King, 2009-2012 * ================================================================== */ package com.jinhe.tss.cms.entity; import java.io.Serializable; import javax.persistence.Embeddable; /** * <p> Attachment实体对象的主键 </p> */ @Embeddable public class AttachmentId implements Serializable { private static final long serialVersionUID = 5924931963789232730L; private Long articleId; //文章编号 PK private Integer seqNo; //附件序号 PK public AttachmentId(){ } public AttachmentId(Long articleId, Integer seqNo){ this.articleId = articleId; this.seqNo = seqNo; } public Long getArticleId() { return articleId; } public Integer getSeqNo() { return seqNo; } public void setArticleId(Long articleId) { this.articleId = articleId; } public void setSeqNo(Integer seqNo) { this.seqNo = seqNo; } public boolean equals(Object obj) { AttachmentId object = (AttachmentId)obj; return this.articleId.equals(object.getArticleId()) && this.seqNo.equals(object.getSeqNo()); } public int hashCode() { return (this.articleId + "_" + this.seqNo).hashCode(); } public String toString() { StringBuffer sb = new StringBuffer(); sb.append("id=").append(this.articleId).append(",seqNo=").append(this.seqNo); return sb.toString(); } }