package cn.com.qmth.examcloud.core.questions.dao.entity.base;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;

@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class MysqlBaseEntity implements JsonSerializable {

	
    /**
	 * 
	 */
	private static final long serialVersionUID = 1774213746500092636L;

	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

	/**
	 * 更新时间
	 */
	@LastModifiedDate
	@Column(nullable = true)
	@Temporal(TemporalType.TIMESTAMP)
	private Date updateTime;

	/**
	 * 创建时间
	 */
	@CreatedDate
	@Column(nullable = true, updatable = false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date creationTime;
	
	/**
	 * 创建人id
	 */
	@CreatedBy
	@Column(nullable = true, updatable = false)
	private Long creationBy;
	
	
	/**
	 * 更新人id
	 */
	@LastModifiedBy
	@Column(nullable = true)
	private Long updateBy;

	



	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Date getCreationTime() {
		return creationTime;
	}

	public void setCreationTime(Date creationTime) {
		this.creationTime = creationTime;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Long getCreationBy() {
		return creationBy;
	}

	public void setCreationBy(Long creationBy) {
		this.creationBy = creationBy;
	}

	public Long getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(Long updateBy) {
		this.updateBy = updateBy;
	}


	
}