/*
 * 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 LoanByUserId implements Serializable {

    private static final long serialVersionUID = -8533525004902104723L;

    @Column(name = "id_loan", length = 36, nullable = true)
    private String idLoan;
    
    @Column(name = "id_user", length = 36, nullable = true)
    private String idUser;

    public LoanByUserId() {
    }

    /**
     *
     * @param idLoan
     * @param idUser
     */
    public LoanByUserId(String idLoan, String idUser) {
        this.idLoan = idLoan;
        this.idUser = idUser;
    }

    public String getIdLoan() {
        return idLoan;
    }

    public void setIdLoan(String idLoan) {
        this.idLoan = idLoan;
    }

    public String getIdUser() {
        return idUser;
    }

    public void setIdUser(String idUser) {
        this.idUser = idUser;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 47 * hash + Objects.hashCode(this.idLoan);
        hash = 47 * hash + Objects.hashCode(this.idUser);
        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 LoanByUserId other = (LoanByUserId) obj;
        if (!Objects.equals(this.idLoan, other.idLoan)) {
            return false;
        }
        if (!Objects.equals(this.idUser, other.idUser)) {
            return false;
        }
        return true;
    }

}
