/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hu.nir.nmail.ejb.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author attila
 */
@Embeddable
public class SmtpSettingsPK implements Serializable {
    @Column(name = "host", nullable = false)
    private String host;
    @Column(name = "smtp_user_name", nullable = false)
    private String smtpUserName;

    public SmtpSettingsPK() {
    }

    public SmtpSettingsPK(String host, String smtpUserName) {
        this.host = host;
        this.smtpUserName = smtpUserName;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getSmtpUserName() {
        return smtpUserName;
    }

    public void setSmtpUserName(String smtpUserName) {
        this.smtpUserName = smtpUserName;
    }

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

    @Override
    public String toString() {
        return "hu.nir.nmail.ejb.entity.SmtpSettingsPK[host=" + host + ", smtpUserName=" + smtpUserName + "]";
    }

}
