Ignore:
Timestamp:
07/07/23 12:14:58 (16 months ago)
Author:
HristijanMitic00 <hristijan.mitic.01@…>
Branches:
main
Parents:
1dd9226
Message:

First commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/project/fmo/app/projcetfmo/Model/Magacioner.java

    r1dd9226 rd14176d  
    1 package model;
     1package project.fmo.app.projcetfmo.Model;
    22
    3 import jakarta.persistence.*;
     3import javax.persistence.*;
    44
    55import java.util.Objects;
    66
    77@Entity
     8@Table(schema = "project", name = "magacioner",  catalog = "db_202223z_va_prj_fmo")
    89public class Magacioner {
    9     @GeneratedValue(strategy = GenerationType.IDENTITY)
    1010    @Id
    1111    @Column(name = "id_korisnik")
    1212    private int idKorisnik;
    13     @Basic
    14     @Column(name = "id_magacin")
    15     private int idMagacin;
     13    @ManyToOne
     14    @JoinColumn(name = "id_magacin")
     15    private Magacin magacin;
    1616
    1717    public int getIdKorisnik() {
     
    2323    }
    2424
    25     public int getIdMagacin() {
    26         return idMagacin;
     25    public Magacin getMagacin() {
     26        return magacin;
    2727    }
    2828
    29     public void setIdMagacin(int idMagacin) {
    30         this.idMagacin = idMagacin;
     29    public void setMagacin(Magacin magacin) {
     30        this.magacin = magacin;
    3131    }
    3232
     
    3636        if (o == null || getClass() != o.getClass()) return false;
    3737        Magacioner that = (Magacioner) o;
    38         return idKorisnik == that.idKorisnik && idMagacin == that.idMagacin;
     38        return idKorisnik == that.idKorisnik && magacin == that.magacin;
    3939    }
    4040
    4141    @Override
    4242    public int hashCode() {
    43         return Objects.hash(idKorisnik, idMagacin);
     43        return Objects.hash(idKorisnik, magacin);
    4444    }
    4545}
Note: See TracChangeset for help on using the changeset viewer.