package com.publiccms.entities.sys;

// Generated 2016-3-2 20:42:39 by Hibernate Tools 4.3.1

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicUpdate;

import com.publiccms.common.generator.annotation.GeneratorColumn;

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

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    @GeneratorColumn(title = "授权验证")
    private String authToken;
    @GeneratorColumn(title = "应用")
    private int appId;
    @GeneratorColumn(title = "创建日期", condition = true)
    private Date createDate;
    @GeneratorColumn(title = "过期日期", condition = true, order = true)
    private Date expiryDate;

    public SysAppToken() {
    }

    public SysAppToken(String authToken, int appId, Date createDate) {
        this.authToken = authToken;
        this.appId = appId;
        this.createDate = createDate;
    }
    public SysAppToken(String authToken, int appId, Date createDate, Date expiryDate) {
        this.authToken = authToken;
        this.appId = appId;
        this.createDate = createDate;
        this.expiryDate = expiryDate;
    }

    @Id

    @Column(name = "auth_token", unique = true, nullable = false, length = 40)
    public String getAuthToken() {
        return this.authToken;
    }

    public void setAuthToken(String authToken) {
        this.authToken = authToken;
    }

    @Column(name = "app_id", nullable = false)
    public int getAppId() {
        return this.appId;
    }

    public void setAppId(int appId) {
        this.appId = appId;
    }

    @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;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "expiry_date", length = 19)
    public Date getExpiryDate() {
        return this.expiryDate;
    }

    public void setExpiryDate(Date expiryDate) {
        this.expiryDate = expiryDate;
    }
}
