Dette.java 1.62 KB
package fr.plil.sio.web.mvc;

import java.util.Objects;
import javax.persistence.*;


@Entity
public class Dette {
    
    @Id
    @GeneratedValue(strategy= GenerationType.AUTO)
    private Long id;
    
    @Column
    private Double sommeDette;

        
    @ManyToOne(optional = false)
    private User dueToUser;
    
    @ManyToOne(optional = false)
    private User holderOfDebt;
    
     public Double getSommeDette() {
        return sommeDette;
    }

    public void setSommeDette(Double sommeDette) {
        this.sommeDette = sommeDette;
    }


    public User getDueToUser() {
        return dueToUser;
    }

    public void setDueToUser(User dueToUser) {
        this.dueToUser = dueToUser;
    }

    public User getHolderOfDebt() {
        return holderOfDebt;
    }

    public void setHolderOfDebt(User holderOfDebt) {
        this.holderOfDebt = holderOfDebt;
    }
    
    
    
    @Override
    public int hashCode() {
        int hash = 5;
        hash = 71 * hash + Objects.hashCode(this.sommeDette);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Dette other = (Dette) obj;
        if (!Objects.equals(this.sommeDette, other.sommeDette)) {
            return false;
        }
        if (!Objects.equals(this.dueToUser, other.dueToUser)) {
            return false;
        }
        if (!Objects.equals(this.holderOfDebt, other.holderOfDebt)) {
            return false;
        }
        return true;
    }





    
    
    
}