package com.jeeplus.modules.casecategory.entity; /**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */

import com.fasterxml.jackson.annotation.JsonBackReference;
import javax.validation.constraints.NotNull;

import com.jeeplus.common.persistence.TreeEntity;

/**
 * Entity
 * @author
 * @version 2017-03-22
 */
public class CaseCategory extends TreeEntity<CaseCategory> {

	private static final long serialVersionUID = 1L;
	private CaseCategory parent;		// 父级编号
	private String parentIds;		// 所有父级编号
	private String name;		// 编号分类名
	private Integer sort;		// 排序
	private String identifier;

	public String getIdentifier() {
		return identifier;
	}

	public void setIdentifier(String identifier) {
		this.identifier = identifier;
	}

	public CaseCategory() {
		super();
	}

	public CaseCategory(String id){
		super(id);
	}

	@JsonBackReference
	public CaseCategory getParent() {
		return parent;
	}

	public void setParent(CaseCategory parent) {
		this.parent = parent;
	}

	public String getParentIds() {
		return parentIds;
	}

	public void setParentIds(String parentIds) {
		this.parentIds = parentIds;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@NotNull(message="排序不能为空")
	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public String getParentId() {
		return parent != null && parent.getId() != null ? parent.getId() : "0";
	}
}