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

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 SysNumberClass extends TreeEntity<SysNumberClass> {
	
	private static final long serialVersionUID = 1L;
	private SysNumberClass parent;		// 父级编号
	private String parentIds;		// 所有父级编号
	private String name;		// 编号分类名
	private Integer sort;		// 排序
	
	public SysNumberClass() {
		super();
	}

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

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

	public void setParent(SysNumberClass 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";
	}
}