package com.jiayue.ipfcst.common.data.entity.qrtz;

import javax.persistence.*;
import java.util.Objects;

/**
 * 定时任务实体
 *
 * @author bizy
 * @version 3.0
 */
@Entity
@Table(name = "qrtz_locks", catalog = "")
@IdClass(QrtzLocksEntityPK.class)
public class QrtzLocksEntity {
    private String schedName;
    private String lockName;

    @Id
    @Column(name = "SCHED_NAME")
    public String getSchedName() {
        return schedName;
    }

    public void setSchedName(String schedName) {
        this.schedName = schedName;
    }

    @Id
    @Column(name = "LOCK_NAME")
    public String getLockName() {
        return lockName;
    }

    public void setLockName(String lockName) {
        this.lockName = lockName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        QrtzLocksEntity that = (QrtzLocksEntity) o;
        return Objects.equals(schedName, that.schedName) &&
                Objects.equals(lockName, that.lockName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(schedName, lockName);
    }
}
