package org.ccpit.business.phase;

import org.ccpit.base.modol.BaseEntity;
import org.hibernate.annotations.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * 报名期数
 * 如 2005-03期
 * Date: 2015年11月16日 08:23
 *
 * @author 孙其鹏
 * @version 1.0
 */
@Entity
@Table(name = "reg_phrase")
@Where(clause = "whetherDelete='false'")
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region = "phase.entity")
public class Phase extends BaseEntity{
    // 名称
    private String name;
    // 考试时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date time;
    // 是否启用
    private boolean active;
    // 是否删除
    private boolean whetherDelete;

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

    public String getName() {
        return name;
    }

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

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public boolean isWhetherDelete() {
        return whetherDelete;
    }

    public void setWhetherDelete(boolean whetherDelete) {
        this.whetherDelete = whetherDelete;
    }
}
