com.quhaodian.data.entity.AbstractEntity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of discover-hibernate-common Show documentation
Show all versions of discover-hibernate-common Show documentation
discover-hibernate_common is a lib for hibernate
package com.quhaodian.data.entity;
import com.quhaodian.data.listener.EntityListener;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
@EntityListeners(EntityListener.class)
@MappedSuperclass
public abstract class AbstractEntity extends LongEntity implements Serializable {
/**
* 添加时间
*/
private Date addDate;
/**
* 最新修改时间
*/
private Date lastDate;
public AbstractEntity() {
inittime();
}
private void inittime() {
addDate = new Date();
lastDate = new Date();
}
public Date getAddDate() {
return addDate;
}
public void setAddDate(Date addDate) {
this.addDate = addDate;
}
public Date getLastDate() {
return lastDate;
}
public void setLastDate(Date lastDate) {
this.lastDate = lastDate;
}
}