📄 notice.java
字号:
/*
* Notice.java
*
* Created on 2007年11月21日, 上午10:07
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package com.ejb;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
/**
* 实体类 Notice
*
* @author hyl
*/
@Entity
public class Notice implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String title;
private String body;
private java.sql.Timestamp publishDate;
private String author;
/** Creates a new instance of Notice */
public Notice() {
}
/**
* 获取此 Notice 的 id。
* @return id
*/
public Long getId() {
return this.id;
}
/**
* 将此 Notice 的 id 设置为指定的值。
* @param id,新建 id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 返回对象的散列代码值。该实现根据此对象
* 中 id 字段计算散列代码值。
* @return 此对象的散列代码值。
*/
@Override
public int hashCode() {
int hash = 0;
hash += (this.id != null ? this.id.hashCode() : 0);
return hash;
}
/**
* 确定其他对象是否等于此 Notice。当且仅当
* 参数不为 null 且该参数是具有与此对象相同 id 字段值的 Notice 对象时,
* 结果才为 <code>true</code>。
* @param 对象,要比较的引用对象
* 如果此对象与参数相同,则 @return <code>true</code>;
* 否则为 <code>false</code>。
*/
@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 Notice)) {
return false;
}
Notice other = (Notice)object;
if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
return true;
}
/**
* 返回对象的字符串表示法。该实现根据 id 字段
* 构造此表示法。
* @return 对象的字符串表示法。
*/
@Override
public String toString() {
return "com.ejb.Notice[id=" + id + "]";
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public java.sql.Timestamp getPublishDate() {
return publishDate;
}
public void setPublishDate(java.sql.Timestamp publishDate) {
this.publishDate = publishDate;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -