/**
 * Company Name : 中贸促信息技术有限责任公司
 * Project Name:project
 * File Name:OrgInfo.java
 * Package Name:org.ccpit.base.orgManage
 * Date:2015年9月18日下午4:45:09
 * Copyright (c) 2015, dingwei@ccpit.org All Rights Reserved.
 *
*/

package org.ccpit.base.orgManage;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

import org.ccpit.base.role.Role;
import org.ccpit.base.user.User;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * ClassName:OrgInfo <br/>
 * Function: TODO 机构信息实体类 <br/>
 * Reason:	 TODO ADD REASON. <br/>
 * Date:     2015年9月18日 下午4:45:09 <br/>
 * @author   dingwei
 * @version  
 * @since    JDK 1.6
 * @see 	 
 */
@Entity
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class OrgInfo implements Serializable{

    /**
	 * serialVersionUID:TODO(用一句话描述这个变量表示什么).
	 * @since JDK 1.6
	 */
	private static final long serialVersionUID = 1L;
	private long id;
	/**
	 * 父id
	 */
	private long parentId;
	/**
	 * 机构名称 
	 */
	private String name;
	/**
	 * 机构编号
	 */
	private String orgNum;
	/**
	 * 排序
	 */
	private Integer orderNumber;
	/**
	 * 机构用户
	 */
    private Set<User> users;
    /**
     * 机构角色
     */
    private Set<Role> roles;
    /**
	 * 父机构名称
	 */
    private String parentName;
	/**
	 * 描述
	 */
	private String description;
	/**
	 * 创建人
	 */
	private String createUser;
	/**
	 * 创建时间
	 */
	private Date createDate;
	/**
	 * 备用字段1
	 */
	private String standby1;
	/**
	 * 备用字段2
	 */
	private String standby2;
	/**
	 * 备用字段3
	 */
	private String standby3;
	/**
	 * 备用字段4
	 */
	private String standby4;
	
	private Integer checked;

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

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

	public long getParentId() {
		return parentId;
	}

	public void setParentId(long parentId) {
		this.parentId = parentId;
	}

	public String getName() {
		return name;
	}

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

	public Integer getOrderNumber() {
		return orderNumber;
	}

	public void setOrderNumber(Integer orderNumber) {
		this.orderNumber = orderNumber;
	}


	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getStandby1() {
		return standby1;
	}

	public void setStandby1(String standby1) {
		this.standby1 = standby1;
	}

	public String getStandby2() {
		return standby2;
	}

	public void setStandby2(String standby2) {
		this.standby2 = standby2;
	}

	public String getStandby3() {
		return standby3;
	}

	public void setStandby3(String standby3) {
		this.standby3 = standby3;
	}

	public String getStandby4() {
		return standby4;
	}

	public void setStandby4(String standby4) {
		this.standby4 = standby4;
	}

	public Integer getChecked() {
		return checked;
	}

	public void setChecked(Integer checked) {
		this.checked = checked;
	}
	@ManyToMany(fetch = FetchType.EAGER)
	public Set<User> getUsers() {
		return users;
	}

	public void setUsers(Set<User> users) {
		this.users = users;
	}
	@ManyToMany(fetch = FetchType.EAGER)
	public Set<Role> getRoles() {
		return roles;
	}

	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}

	public String getOrgNum() {
		return orgNum;
	}

	public void setOrgNum(String orgNum) {
		this.orgNum = orgNum;
	}
	
	
}

