package com.izouma.uwip.domain;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where;

import javax.persistence.Entity;
import javax.persistence.Transient;
import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.List;

@AllArgsConstructor
@Data
@Builder
@NoArgsConstructor
@Entity
@ApiModel(value = "维护信息")
@Where(clause = "del = 0")
public class Maintenance extends BaseEntity {

    private String name;

    @Size(max = 50)
    private String description;

    @Size(min = 1,max = 50)
    private String flag;

    private Long parent;

    @Transient
    private List<Maintenance> children = new ArrayList<>();

}
