package com.publiccms.entities.cms;
// Generated 2021-09-23 16:55:08 by Hibernate Tools 6.0.0-SNAPSHOT

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicUpdate;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.publiccms.common.generator.annotation.GeneratorColumn;

/**
 * CmsUserSurveyQuestion generated by hbm2java
 */
@Entity
@Table(name = "cms_user_survey_question")
@DynamicUpdate
public class CmsUserSurveyQuestion implements java.io.Serializable {

    /**
    *
    */
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @GeneratorColumn(title = "ID")
    private CmsUserSurveyQuestionId id;
    @JsonIgnore
    @GeneratorColumn(title = "站点", condition = true)
    private short siteId;
    /**
     * survey id<p>
     * 问卷调查id
     */
    @GeneratorColumn(title = "问卷", condition = true)
    private long surveyId;
    /**
     * answer<p>
     * 答案
     */
    @GeneratorColumn(title = "答案")
    private String answer;
    /**
     * score<p>
     * 分数
     */
    @GeneratorColumn(title = "分数", order = true)
    private Integer score;
    /**
     * create date<p>
     * 创建日期
     */
    @GeneratorColumn(title = "创建日期", order = true)
    private Date createDate;

    public CmsUserSurveyQuestion() {
    }

    public CmsUserSurveyQuestion(short siteId, long surveyId, Date createDate) {
        this.siteId = siteId;
        this.surveyId = surveyId;
        this.createDate = createDate;
    }

    public CmsUserSurveyQuestion(short siteId, long surveyId, String answer, int score, Date createDate) {
        this.siteId = siteId;
        this.surveyId = surveyId;
        this.answer = answer;
        this.score = score;
        this.createDate = createDate;
    }

    @EmbeddedId
    @AttributeOverrides({ @AttributeOverride(name = "userId", column = @Column(name = "user_id", nullable = false)),
            @AttributeOverride(name = "questionId", column = @Column(name = "question_id", nullable = false)) })
    public CmsUserSurveyQuestionId getId() {
        return this.id;
    }

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

    @Column(name = "site_id", nullable = false)
    public short getSiteId() {
        return this.siteId;
    }

    public void setSiteId(short siteId) {
        this.siteId = siteId;
    }

    @Column(name = "survey_id", nullable = false)
    public long getSurveyId() {
        return this.surveyId;
    }

    public void setSurveyId(long surveyId) {
        this.surveyId = surveyId;
    }

    @Column(name = "answer")
    public String getAnswer() {
        return this.answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    @Column(name = "score")
    public Integer getScore() {
        return this.score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "create_date", nullable = false, length = 19)
    public Date getCreateDate() {
        return this.createDate;
    }

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