package com.sysu.admin.controller.lz.period;

import com.sysu.admin.utils.TextUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.experimental.FieldNameConstants;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@FieldNameConstants(innerTypeName = "FIELDS")
@Table(name = "lz_period")
@Entity
@DynamicInsert
@DynamicUpdate
public class LzPeriod {

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

    /**
     * (白点期、春稍期、抽穗期、开花期)
     */
    @Column()
    private String name;

    @Column()
    private String color;

    @Column()
    private String attrNames;

    public String[] getAttrs(){
        return TextUtil.split(this.attrNames,",");
    }
}













