entity.java
来自「开源项目simpleoa-0.3.zip是最新版本」· Java 代码 · 共 38 行
JAVA
38 行
package com.ejsun.entapps.domain;
import java.io.Serializable;
/**
* @author Quake Wang
* @since 2004-4-5
* @version $Revision: 1.1 $
*
**/
public abstract class Entity implements Serializable {
private long id = -1;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public boolean isNew() {
return (this.id == -1);
}
public boolean equals(Object o) {
if (this == o) //quick return
return true;
if (!(o instanceof Entity))
return false;
return (id == ((Entity) o).getId());
}
public String toString() {
return (this.getClass().getName() + " " + id);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?