package cz.muni.fi.pv243.mustech.model;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.Data;

import javax.persistence.Cacheable;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author Milan
 */
@Data
@Cacheable(true)
@MappedSuperclass
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class BaseModel implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    protected Long id;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        Issue issue = (Issue) o;

        return Objects.equals(issue.id, id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}

@@ -712,375 +712,7 @@
  id;
-%0A%0A    @Override%0A    public boolean equals(Object o) %7B%0A        if (this == o) return true;%0A        if (o == null %7C%7C getClass() != o.getClass()) return false;%0A        if (!super.equals(o)) return false;%0A%0A        Issue issue = (Issue) o;%0A%0A        return Objects.equals(issue.id, id);%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        return Objects.hash(id);%0A    %7D
 %0A%7D%0A

remove custom hash+equals from basemodel