package HibernateEntities;

import javax.persistence.*;

/**
 * Created by Кинетик on 28.12.2016.
 */
@Entity
@Table(name = "clients", schema = "anketa", catalog = "")
public class ClientsEntity {
    private int clientId;
    private String clFamily;
    private String clFirstName;
    private String clSecName;
    private String clPassword;

    @Id
    @Column(name = "client_id")
    public int getClientId() {
        return clientId;
    }

    public void setClientId(int clientId) {
        this.clientId = clientId;
    }

    @Basic
    @Column(name = "cl_family")
    public String getClFamily() {
        return clFamily;
    }

    public void setClFamily(String clFamily) {
        this.clFamily = clFamily;
    }

    @Basic
    @Column(name = "cl_first_name")
    public String getClFirstName() {
        return clFirstName;
    }

    public void setClFirstName(String clFirstName) {
        this.clFirstName = clFirstName;
    }

    @Basic
    @Column(name = "cl_sec_name")
    public String getClSecName() {
        return clSecName;
    }

    public void setClSecName(String clSecName) {
        this.clSecName = clSecName;
    }

    @Basic
    @Column(name = "cl_password")
    public String getClPassword() {
        return clPassword;
    }

    public void setClPassword(String clPassword) {
        this.clPassword = clPassword;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ClientsEntity that = (ClientsEntity) o;

        if (clientId != that.clientId) return false;
        if (clFamily != null ? !clFamily.equals(that.clFamily) : that.clFamily != null) return false;
        if (clFirstName != null ? !clFirstName.equals(that.clFirstName) : that.clFirstName != null) return false;
        if (clSecName != null ? !clSecName.equals(that.clSecName) : that.clSecName != null) return false;
        if (clPassword != null ? !clPassword.equals(that.clPassword) : that.clPassword != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = clientId;
        result = 31 * result + (clFamily != null ? clFamily.hashCode() : 0);
        result = 31 * result + (clFirstName != null ? clFirstName.hashCode() : 0);
        result = 31 * result + (clSecName != null ? clSecName.hashCode() : 0);
        result = 31 * result + (clPassword != null ? clPassword.hashCode() : 0);
        return result;
    }
}
