/**
* 存放上傳的文件
*
*/
@Entity
public class UploadFile implements Serializable{
private static final long serialVersionUID = 7291850395925809042L;
private Integer id;
private String filepath;
private Date uploadtime = new Date();
public UploadFile() {}
public UploadFile(String filepath) {
this.filepath = filepath;
}
@Id @GeneratedValue
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Column(nullable=false,length=80)
public String getFilepath() {
return filepath;
}
public void setFilepath(String filepath) {
this.filepath = filepath;
}
@Temporal(TemporalType.TIMESTAMP)
public Date getUploadtime() {
return uploadtime;
}
public void setUploadtime(Date uploadtime) {
this.uploadtime = uploadtime;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final UploadFile other = (UploadFile) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}
購物網站6:存放上傳文件的實體類
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.