/*
 * 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 javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TSAFEPASSWORD")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tsafepassword.findAll", query = "SELECT t FROM Tsafepassword t"),
    @NamedQuery(name = "Tsafepassword.findByCompanycode", query = "SELECT t FROM Tsafepassword t WHERE t.tsafepasswordPK.companycode = :companycode"),
    @NamedQuery(name = "Tsafepassword.findByChannelcode", query = "SELECT t FROM Tsafepassword t WHERE t.tsafepasswordPK.channelcode = :channelcode"),
    @NamedQuery(name = "Tsafepassword.findByValiditydays", query = "SELECT t FROM Tsafepassword t WHERE t.validitydays = :validitydays"),
    @NamedQuery(name = "Tsafepassword.findByMinlength", query = "SELECT t FROM Tsafepassword t WHERE t.minlength = :minlength"),
    @NamedQuery(name = "Tsafepassword.findByMinnotrepeated", query = "SELECT t FROM Tsafepassword t WHERE t.minnotrepeated = :minnotrepeated"),
    @NamedQuery(name = "Tsafepassword.findByMinnumber", query = "SELECT t FROM Tsafepassword t WHERE t.minnumber = :minnumber"),
    @NamedQuery(name = "Tsafepassword.findByMinspecialcharacters", query = "SELECT t FROM Tsafepassword t WHERE t.minspecialcharacters = :minspecialcharacters"),
    @NamedQuery(name = "Tsafepassword.findByMinuppercase", query = "SELECT t FROM Tsafepassword t WHERE t.minuppercase = :minuppercase"),
    @NamedQuery(name = "Tsafepassword.findByMinlowercase", query = "SELECT t FROM Tsafepassword t WHERE t.minlowercase = :minlowercase"),
    @NamedQuery(name = "Tsafepassword.findByMessagedays", query = "SELECT t FROM Tsafepassword t WHERE t.messagedays = :messagedays"),
    @NamedQuery(name = "Tsafepassword.findByIntentnumber", query = "SELECT t FROM Tsafepassword t WHERE t.intentnumber = :intentnumber")})
public class Tsafepassword implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TsafepasswordPK tsafepasswordPK;
    @Column(name = "VALIDITYDAYS")
    private Short validitydays;
    @Column(name = "MINLENGTH")
    private Short minlength;
    @Column(name = "MINNOTREPEATED")
    private Short minnotrepeated;
    @Column(name = "MINNUMBER")
    private Short minnumber;
    @Column(name = "MINSPECIALCHARACTERS")
    private Short minspecialcharacters;
    @Column(name = "MINUPPERCASE")
    private Short minuppercase;
    @Column(name = "MINLOWERCASE")
    private Short minlowercase;
    @Column(name = "MESSAGEDAYS")
    private Short messagedays;
    @Column(name = "INTENTNUMBER")
    private Short intentnumber;
    @JoinColumn(name = "CHANNELCODE", referencedColumnName = "CHANNELCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenechannels tgenechannels;
    @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenecompany tgenecompany;

    public Tsafepassword() {
    }

    public Tsafepassword(TsafepasswordPK tsafepasswordPK) {
        this.tsafepasswordPK = tsafepasswordPK;
    }

    public Tsafepassword(long companycode, String channelcode) {
        this.tsafepasswordPK = new TsafepasswordPK(companycode, channelcode);
    }

    public TsafepasswordPK getTsafepasswordPK() {
        return tsafepasswordPK;
    }

    public void setTsafepasswordPK(TsafepasswordPK tsafepasswordPK) {
        this.tsafepasswordPK = tsafepasswordPK;
    }

    public Short getValiditydays() {
        return validitydays;
    }

    public void setValiditydays(Short validitydays) {
        this.validitydays = validitydays;
    }

    public Short getMinlength() {
        return minlength;
    }

    public void setMinlength(Short minlength) {
        this.minlength = minlength;
    }

    public Short getMinnotrepeated() {
        return minnotrepeated;
    }

    public void setMinnotrepeated(Short minnotrepeated) {
        this.minnotrepeated = minnotrepeated;
    }

    public Short getMinnumber() {
        return minnumber;
    }

    public void setMinnumber(Short minnumber) {
        this.minnumber = minnumber;
    }

    public Short getMinspecialcharacters() {
        return minspecialcharacters;
    }

    public void setMinspecialcharacters(Short minspecialcharacters) {
        this.minspecialcharacters = minspecialcharacters;
    }

    public Short getMinuppercase() {
        return minuppercase;
    }

    public void setMinuppercase(Short minuppercase) {
        this.minuppercase = minuppercase;
    }

    public Short getMinlowercase() {
        return minlowercase;
    }

    public void setMinlowercase(Short minlowercase) {
        this.minlowercase = minlowercase;
    }

    public Short getMessagedays() {
        return messagedays;
    }

    public void setMessagedays(Short messagedays) {
        this.messagedays = messagedays;
    }

    public Short getIntentnumber() {
        return intentnumber;
    }

    public void setIntentnumber(Short intentnumber) {
        this.intentnumber = intentnumber;
    }

    public Tgenechannels getTgenechannels() {
        return tgenechannels;
    }

    public void setTgenechannels(Tgenechannels tgenechannels) {
        this.tgenechannels = tgenechannels;
    }

    public Tgenecompany getTgenecompany() {
        return tgenecompany;
    }

    public void setTgenecompany(Tgenecompany tgenecompany) {
        this.tgenecompany = tgenecompany;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tsafepasswordPK != null ? tsafepasswordPK.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 Tsafepassword)) {
            return false;
        }
        Tsafepassword other = (Tsafepassword) object;
        if ((this.tsafepasswordPK == null && other.tsafepasswordPK != null) || (this.tsafepasswordPK != null && !this.tsafepasswordPK.equals(other.tsafepasswordPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.Tsafepassword[ tsafepasswordPK=" + tsafepasswordPK + " ]";
    }
    
}
