package com.publiccms.entities.sys;
// Generated 2022-2-9 10:19:58 by Hibernate Tools 5.4.32.Final

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.publiccms.common.generator.annotation.GeneratorColumn;

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

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    @GeneratorColumn(title = "ID")
    private SysLockId id;
    /**
     * user id<p>
     * 用户id
     */
    @GeneratorColumn(title = "锁定用户")
    private Long userId;
    /**
     * locked count<p>
     * 锁定次数
     */
    @GeneratorColumn(title = "锁定次数")
    private int count;
    /**
     * create date<p>
     * 创建日期
     */
    @GeneratorColumn(title = "创建日期")
    private Date createDate;
    /**
     * update date<p>
     * 更新日期
     */
    @GeneratorColumn(title = "更新日期")
    private Date updateDate;

    public SysLock() {
    }

    public SysLock(SysLockId id, int count, Date createDate) {
        this.id = id;
        this.count = count;
        this.createDate = createDate;
    }

    public SysLock(SysLockId id, Long userId, int count, Date createDate, Date updateDate) {
        this.id = id;
        this.userId = userId;
        this.count = count;
        this.createDate = createDate;
        this.updateDate = updateDate;
    }

    @EmbeddedId
    @AttributeOverrides({
            @AttributeOverride(name="siteId", column=@Column(name="site_id", nullable=false) ), 
            @AttributeOverride(name = "itemType", column = @Column(name = "item_type", nullable = false, length = 50)),
            @AttributeOverride(name = "itemId", column = @Column(name = "item_id", nullable = false)) })
    public SysLockId getId() {
        return this.id;
    }

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

    @Column(name = "user_id")
    public Long getUserId() {
        return this.userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Column(name = "count", nullable = false)
    public int getCount() {
        return this.count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    @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 = "update_date", length = 19)
    public Date getUpdateDate() {
        return this.updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }
}