/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.qsoft.rs.sincoar.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author developer2
 */
@Embeddable
public class TsafeauditPK implements Serializable {

    @Basic(optional = false)
    @Column(name = "CHANGEDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date changedate;
    @Basic(optional = false)
    @Column(name = "TABLENAME")
    private String tablename;
    @Basic(optional = false)
    @Column(name = "COLUMNNAME")
    private String columnname;
    @Basic(optional = false)
    @Column(name = "PARTITIONDB")
    private String partitiondb;
    @Basic(optional = false)
    @Column(name = "REALDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date realdate;

    public TsafeauditPK() {
    }

    public TsafeauditPK(Date changedate, String tablename, String columnname, String partitiondb, Date realdate) {
        this.changedate = changedate;
        this.tablename = tablename;
        this.columnname = columnname;
        this.partitiondb = partitiondb;
        this.realdate = realdate;
    }

    public Date getChangedate() {
        return changedate;
    }

    public void setChangedate(Date changedate) {
        this.changedate = changedate;
    }

    public String getTablename() {
        return tablename;
    }

    public void setTablename(String tablename) {
        this.tablename = tablename;
    }

    public String getColumnname() {
        return columnname;
    }

    public void setColumnname(String columnname) {
        this.columnname = columnname;
    }

    public String getPartitiondb() {
        return partitiondb;
    }

    public void setPartitiondb(String partitiondb) {
        this.partitiondb = partitiondb;
    }

    public Date getRealdate() {
        return realdate;
    }

    public void setRealdate(Date realdate) {
        this.realdate = realdate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (changedate != null ? changedate.hashCode() : 0);
        hash += (tablename != null ? tablename.hashCode() : 0);
        hash += (columnname != null ? columnname.hashCode() : 0);
        hash += (partitiondb != null ? partitiondb.hashCode() : 0);
        hash += (realdate != null ? realdate.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TsafeauditPK)) {
            return false;
        }
        TsafeauditPK other = (TsafeauditPK) object;
        if ((this.changedate == null && other.changedate != null) || (this.changedate != null && !this.changedate.equals(other.changedate))) {
            return false;
        }
        if ((this.tablename == null && other.tablename != null) || (this.tablename != null && !this.tablename.equals(other.tablename))) {
            return false;
        }
        if ((this.columnname == null && other.columnname != null) || (this.columnname != null && !this.columnname.equals(other.columnname))) {
            return false;
        }
        if ((this.partitiondb == null && other.partitiondb != null) || (this.partitiondb != null && !this.partitiondb.equals(other.partitiondb))) {
            return false;
        }
        if ((this.realdate == null && other.realdate != null) || (this.realdate != null && !this.realdate.equals(other.realdate))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.TsafeauditPK[ changedate=" + changedate + ", tablename=" + tablename + ", columnname=" + columnname + ", partitiondb=" + partitiondb + ", realdate=" + realdate + " ]";
    }
    
}
