package cn.enilu.flash.bean.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
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 javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.util.Date;



/**
 * Created  on 2019/1/8 0002.
 *
 * @author enilu
 */
@MappedSuperclass
@Data
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public abstract class BaseEntity implements Serializable {

    @Id
    @GeneratedValue
    private Long id;
    @CreatedDate
    @Column(name = "create_time",columnDefinition="DATETIME COMMENT '创建时间/注册时间'",updatable = false)
    private Date createTime;
    @Column(name = "create_by",columnDefinition="bigint COMMENT '创建人'",updatable = false)
    @CreatedBy
    private Long createBy;
    @LastModifiedDate
    @Column(name = "modify_time",columnDefinition="DATETIME COMMENT '最后更新时间'")
    private Date modifyTime;
    @LastModifiedBy
    @Column(name = "modify_by",columnDefinition="bigint COMMENT '最后更新人'")
    private Long modifyBy;
}

@@ -123,36 +123,25 @@
 ort org.
-springframework.data
+hibernate
 .annotat
@@ -147,18 +147,27 @@
 tion
+s
 .Creat
-edBy
+ionTimestamp
 ;%0Aim
@@ -175,36 +175,25 @@
 ort org.
-springframework.data
+hibernate
 .annotat
@@ -199,20 +199,25 @@
 tion
-.CreatedDate
+s.UpdateTimestamp
 ;%0Aim
@@ -257,26 +257,21 @@
 otation.
-LastModifi
+Creat
 edBy;%0Aim
@@ -323,20 +323,18 @@
 Modified
-Date
+By
 ;%0A%0Aimpor
@@ -803,22 +803,28 @@
   @Creat
-edDate
+ionTimestamp
 %0A    @Co
@@ -1086,24 +1086,23 @@
    @
-LastModifiedDate
+UpdateTimestamp
 %0A   

Change BaseEntity 创建日期和更新日期使用hibernate注解代替spring的注解