package cn.com.qmth.stmms.biz.exam.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang.StringUtils;

@Entity
@Table(name = "eb_exam_package")
public class ExamPackage implements Serializable {

    private static final long serialVersionUID = 1713850212826781261L;

    @EmbeddedId
    private ExamPackagePK pk;

    @Column(name = "pic_count")
    private Integer picCount;

    @Transient
    private List<String> urls;

    public ExamPackage() {
        this.pk = new ExamPackagePK();
    }

    public Integer getExamId() {
        return pk.getExamId();
    }

    public void setExamId(Integer examId) {
        pk.setExamId(examId);
    }

    public String getCode() {
        return pk.getCode();
    }

    public void setCode(String code) {
        pk.setCode(code);
    }

    public Integer getPicCount() {
        return picCount;
    }

    public void setPicCount(Integer picCount) {
        this.picCount = picCount;
    }

    public List<String> getUrls() {
        return urls;
    }

    public void setUrls(List<String> urls) {
        this.urls = urls;
    }

    public String getUrlString() {
        if (urls != null) {
            return StringUtils.join(urls, ",");
        } else {
            return "";
        }
    }

}
