/*
 * Arrebol Consultancy copyright.
 * 
 * This code belongs to Arrebol Consultancy
 * its use, redistribution or modification are prohibited 
 * without written authorization from Arrebol Consultancy.
 */
package com.arrebol.apc.model.loan;

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

/**
 *
 * @author Carlos Janitzio Zavala Lopez <janitzio.zavala@arrebol.com.mx>
 */
@Embeddable
public class LoanByRenovationId implements Serializable {

    private static final long serialVersionUID = 5820034171440805154L;

    @Column(name = "id_loan_old", length = 36, nullable = true)
    private String idLoanOld;

    @Column(name = "id_loan_new", length = 36, nullable = true)
    private String idUserNew;

    public LoanByRenovationId() {
    }

    /**
     *
     * @param idLoanOld
     * @param idUserNew
     */
    public LoanByRenovationId(String idLoanOld, String idUserNew) {
        this.idLoanOld = idLoanOld;
        this.idUserNew = idUserNew;
    }

    public String getIdLoanOld() {
        return idLoanOld;
    }

    public void setIdLoanOld(String idLoanOld) {
        this.idLoanOld = idLoanOld;
    }

    public String getIdUserNew() {
        return idUserNew;
    }

    public void setIdUserNew(String idUserNew) {
        this.idUserNew = idUserNew;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 41 * hash + Objects.hashCode(this.idLoanOld);
        hash = 41 * hash + Objects.hashCode(this.idUserNew);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final LoanByRenovationId other = (LoanByRenovationId) obj;
        if (!Objects.equals(this.idLoanOld, other.idLoanOld)) {
            return false;
        }
        if (!Objects.equals(this.idUserNew, other.idUserNew)) {
            return false;
        }
        return true;
    }

}
