package com.zhangmeng.model.base.baseEntity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author zhangmeng
 * @version 1.0
 * @date 2020年11月13日09:58:11
 * @param <ID>
 */
@Data
@MappedSuperclass
@JsonIgnoreProperties(ignoreUnknown = true, value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
public class BaseEntity<ID extends Serializable> implements Serializable {

    @Id    //主键id
    @GeneratedValue(strategy= GenerationType.IDENTITY)//主键生成策略
    @Column(name="id")//数据库字段名
    private ID id;

    @Column(name = "addTime",length = 0)
    private Date addTime = new Date();

    @Column(name = "updateTime",length = 0)
    private Date updateTime = new Date();

    @Column(name = "deleteStatus")
    private Boolean deleteStatus = false;
}
