package com.palmnest.model;

import com.palmnest.model.property.TbOrganization;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @Author hxt
 * @Description 项目数据字典配置项
 * @Date 2019/1/7 14:28
 **/
@Entity
@Table(name = "tb_dictionary_org_item")
public class OrgElement implements Serializable {

	private static final long serialVersionUID = 6616566468455250623L;

	private Long           id;
	private String         itemname;
	private Integer        isenabled;
	private Date           createtime;
	private Integer        orderno;
	private ElementGroup   elementGroup;
	private User           creator;
	private TbOrganization organization;
	private String 		   code;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getItemname() {
		return itemname;
	}

	public void setItemname(String itemname) {
		this.itemname = itemname;
	}

	public Integer getIsenabled() {
		return isenabled;
	}

	public void setIsenabled(Integer isenabled) {
		this.isenabled = isenabled;
	}

	public Date getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	public Integer getOrderno() {
		return orderno;
	}

	public void setOrderno(Integer orderno) {
		this.orderno = orderno;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "groupid")
	public ElementGroup getElementGroup() {
		return elementGroup;
	}

	public void setElementGroup(ElementGroup elementGroup) {
		this.elementGroup = elementGroup;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "creator")
	public User getCreator() {
		return creator;
	}

	public void setCreator(User creator) {
		this.creator = creator;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "orgid")
	public TbOrganization getOrganization() {
		return organization;
	}

	public void setOrganization(TbOrganization organization) {
		this.organization = organization;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
}
