Project

General

Profile

1
package eu.dnetlib.goldoa.domain;
2

    
3
import com.google.gwt.user.client.rpc.IsSerializable;
4

    
5
import javax.persistence.ManyToOne;
6
import java.io.Serializable;
7

    
8
/**
9
 * Created by panagiotis on 24/1/2017.
10
 */
11
public class PublisherDiscountPK implements IsSerializable, Serializable {
12

    
13
    private static final long serialVersionUID = 1L;
14

    
15
    @ManyToOne
16
    //@JsonBackReference(value = "publisher")
17
    private Publisher publisher;
18
    @ManyToOne
19
   // @JsonBackReference(value="organization")
20
    private Organization organization;
21

    
22
    public Publisher getPublisher() {
23
        return publisher;
24
    }
25

    
26
    public void setPublisher(Publisher publisher) {
27
        this.publisher = publisher;
28
    }
29

    
30
    public Organization getOrganization() {
31
        return organization;
32
    }
33

    
34
    public void setOrganization(Organization organization) {
35
        this.organization = organization;
36
    }
37

    
38
    @Override
39
    public boolean equals(Object o) {
40
        if (this == o) return true;
41
        if (o == null || getClass() != o.getClass()) return false;
42

    
43
        PublisherDiscountPK that = (PublisherDiscountPK) o;
44

    
45
        if (publisher != null ? !publisher.equals(that.publisher) : that.publisher != null) return false;
46
        return organization != null ? organization.equals(that.organization) : that.organization == null;
47
    }
48

    
49
    @Override
50
    public int hashCode() {
51
        int result = publisher != null ? publisher.hashCode() : 0;
52
        result = 31 * result + (organization != null ? organization.hashCode() : 0);
53
        return result;
54
    }
55
}
56

    
(38-38/52)