package cn.com.qmth.examcloud.core.questions.dao.entity;

import cn.com.qmth.examcloud.core.questions.dao.entity.base.IdEntity;
import cn.com.qmth.examcloud.core.questions.dao.entity.dto.PropertyDto;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 * @author weiwenhai
 * @describle 属性
 * @date 2017.11.6
 */
@Entity
@Table(name = "ecs_ques_property")
public class Property extends IdEntity {
    @NotNull
    private String name;

    @NotNull
    private Long parentId;

    @NotNull
    private Integer number;//序号

    @NotNull
    private Long coursePropertyId;

    private String remark;

    @NotNull
    private Long orgId;

    public Property() {

    }

    public Property(PropertyDto propertyDto) {
        this.id = propertyDto.getId();
        this.name = propertyDto.getName();
        this.parentId = propertyDto.getParentId();
        this.number = propertyDto.getNumber();
        this.coursePropertyId = propertyDto.getCoursePropertyId();
        this.remark = propertyDto.getRemark();
    }

    public Property(String name, Long parentId, Long coursePropertyId) {
        this.name = name;
        this.parentId = parentId;
        this.coursePropertyId = coursePropertyId;
    }

    public Long getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

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

    public Long getParentId() {
        return parentId;
    }

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

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public Long getCoursePropertyId() {
        return coursePropertyId;
    }

    public void setCoursePropertyId(Long coursePropertyId) {
        this.coursePropertyId = coursePropertyId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

}