Project

General

Profile

1
package eu.dnetlib.organizations.model.view;
2

    
3
import java.io.Serializable;
4
import java.util.Objects;
5

    
6
import javax.persistence.Column;
7
import javax.persistence.Entity;
8
import javax.persistence.Id;
9
import javax.persistence.Table;
10

    
11
import org.hibernate.annotations.Type;
12
import org.hibernate.annotations.TypeDef;
13
import org.hibernate.annotations.TypeDefs;
14

    
15
import com.vladmihalcea.hibernate.type.array.StringArrayType;
16

    
17
@Entity
18
@Table(name = "organizations_simple_view")
19
@TypeDefs({
20
		@TypeDef(name = "string-array", typeClass = StringArrayType.class)
21
})
22
public class OrganizationSimpleView implements Serializable {
23

    
24
	/**
25
	 *
26
	 */
27
	private static final long serialVersionUID = 417248897119259446L;
28

    
29
	@Id
30
	@Column(name = "id")
31
	private String id;
32

    
33
	@Column(name = "name")
34
	private String name;
35

    
36
	@Column(name = "type")
37
	private String type;
38

    
39
	@Column(name = "city")
40
	private String city;
41

    
42
	@Column(name = "country")
43
	private String country;
44

    
45
	@Type(type = "string-array")
46
	@Column(name = "acronyms", columnDefinition = "text[]")
47
	private String[] acronyms;
48

    
49
	public OrganizationSimpleView() {}
50

    
51
	public OrganizationSimpleView(final String id, final String name, final String type, final String city, final String country, final String[] acronyms) {
52
		this.id = id;
53
		this.name = name;
54
		this.type = type;
55
		this.city = city;
56
		this.country = country;
57
		this.acronyms = acronyms;
58
	}
59

    
60
	public String getId() {
61
		return id;
62
	}
63

    
64
	public void setId(final String id) {
65
		this.id = id;
66
	}
67

    
68
	public String getName() {
69
		return name;
70
	}
71

    
72
	public void setName(final String name) {
73
		this.name = name;
74
	}
75

    
76
	public String getType() {
77
		return type;
78
	}
79

    
80
	public void setType(final String type) {
81
		this.type = type;
82
	}
83

    
84
	public String getCity() {
85
		return city;
86
	}
87

    
88
	public void setCity(final String city) {
89
		this.city = city;
90
	}
91

    
92
	public String getCountry() {
93
		return country;
94
	}
95

    
96
	public void setCountry(final String country) {
97
		this.country = country;
98
	}
99

    
100
	public String[] getAcronyms() {
101
		return acronyms;
102
	}
103

    
104
	public void setAcronyms(final String[] acronyms) {
105
		this.acronyms = acronyms;
106
	}
107

    
108
	@Override
109
	public int hashCode() {
110
		return Objects.hash(id);
111
	}
112

    
113
	@Override
114
	public boolean equals(final Object obj) {
115
		if (this == obj) { return true; }
116
		if (obj == null) { return false; }
117
		if (!(obj instanceof OrganizationSimpleView)) { return false; }
118
		final OrganizationSimpleView other = (OrganizationSimpleView) obj;
119
		return Objects.equals(id, other.id);
120
	}
121

    
122
}
(4-4/8)