@@ -0,0 +1,1809 @@
+package cz.fi.muni.pa165.seminar.pkmnleague.domain;%0A%0Aimport java.util.Objects;%0Aimport javax.persistence.Entity;%0Aimport javax.persistence.GeneratedValue;%0Aimport javax.persistence.GenerationType;%0Aimport javax.persistence.Id;%0Aimport javax.persistence.JoinColumn;%0Aimport javax.persistence.ManyToOne;%0Aimport javax.validation.constraints.NotNull;%0A%0A/**%0A * @author Zuzana Goldmannova%0A */%0A@Entity%0Apublic class Badge %7B%0A    %0A    @Id%0A    @GeneratedValue(strategy = GenerationType.IDENTITY)%0A    private int id;%0A    %0A    @NotNull%0A    @ManyToOne()%0A    @JoinColumn(name=%22TRAINER_ID%22)%0A    private Trainer trainer;%0A    %0A    @NotNull%0A    @ManyToOne()%0A    @JoinColumn(name=%22GYM_ID%22)%0A    private Gym gym;%0A    %0A    public Badge(Trainer trainer, Gym gym) %7B%0A        this.trainer = trainer;%0A        this.gym = gym;%0A%0A    %7D%0A    %0A    public int getId() %7B%0A        return id;%0A    %7D%0A    %0A    public Trainer getTrainer() %7B%0A        return trainer;%0A    %7D%0A    %0A    public Gym getGym() %7B%0A        return gym;%0A    %7D%0A    %0A    public void setTrainer(Trainer trainer) %7B%0A        this.trainer = trainer;%0A    %7D%0A    %0A    public void setGym(Gym gym) %7B%0A        this.gym = gym;%0A    %7D%0A    %0A    @Override%0A    public int hashCode() %7B%0A        int hash = this.id;%0A        hash = 31 * hash + Objects.hashCode(this.gym);%0A        hash = 31 * hash + Objects.hashCode(this.trainer);%0A        return hash;%0A    %7D%0A    %0A    @Override%0A    public boolean equals(Object obj) %7B%0A        if (obj == null) %7B%0A            return false;%0A        %7D%0A        if (getClass() != obj.getClass()) %7B%0A            return false;%0A        %7D%0A        final Badge other = (Badge) obj;%0A%0A        if (!Objects.equals(this.gym, other.gym)) %7B%0A            return false;%0A        %7D%0A        if (!Objects.equals(this.trainer, other.trainer)) %7B%0A            return false;%0A        %7D%0A        return true;%0A    %7D%0A%7D%0A

Create Badge.java