package fastweb.domain.dataagent;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import fastweb.util.Date2StringSerializer;
import fastweb.util.TimeStamp2StringSeriallizer;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;

@Entity
@Data
@Table(name = "artical")
@JsonIgnoreProperties({"hibernateLazyInitializer","handler"})
public class Artical {

    /**
     * 用户唯一id
     */
    @Id
    @GeneratedValue(generator = "idGenerator")
    @GenericGenerator(name = "idGenerator", strategy = "uuid")
    @Column(name = "ID", nullable = false, length = 42)
    private String id;

    @Column(name = "NAME", nullable = false, length = 100)
    private String name;

    @Column(name = "CONTENT", nullable = false, length = 2000)
    private String content;

    @Column(name = "TYPE", nullable = false, length = 2000)
    private Integer type;

    @Column(name = "STATUS", nullable = false, length = 2000)
    private Boolean status;


    @Column(name = "CREATED_DATE", nullable = false)
    @JsonSerialize(using = Date2StringSerializer.class)
    private Date date;


}