Project

General

Profile

1
package eu.dnetlib.datasource.publisher.model.db;
2

    
3
import java.sql.Date;
4
import java.util.Objects;
5
import java.util.Set;
6
import javax.persistence.*;
7

    
8
import com.fasterxml.jackson.annotation.JsonAutoDetect;
9
import com.fasterxml.jackson.annotation.JsonIgnore;
10
import com.google.gson.Gson;
11
import io.swagger.annotations.ApiModel;
12

    
13
/**
14
 * Api
15
 */
16
@Entity
17
@Table(name = "api")
18
@JsonAutoDetect
19
@ApiModel(value = "Datasource Api model", description = "describes the datasource api")
20
public class Api {
21

    
22
	@Id
23
	private String id = null;
24

    
25
	private String protocol = null;
26
	@JsonIgnore
27
	@ManyToOne
28
	@JoinColumn(name = "datasource")
29
	private Datasource datasource = null;
30
	private String contentdescription = null;
31
	private Boolean active = false;
32
	private Boolean removable = false;
33
	private String typology = null;
34

    
35
	private String compatibility;
36

    
37
	@Column(name = "metadata_identifier_path")
38
	private String metadataIdentifierPath;
39

    
40
	@Column(name = "last_collection_total")
41
	private Integer lastCollectionTotal;
42
	@Column(name = "last_collection_date")
43
	private Date lastCollectionDate;
44
	@Column(name = "last_collection_mdid")
45
	private String lastCollectionMdid;
46

    
47
	@Column(name = "last_aggregation_total")
48
	private Integer lastAggregationTotal;
49
	@Column(name = "last_aggregation_date")
50
	private Date lastAggregationDate;
51
	@Column(name = "last_aggregation_mdid")
52
	private String lastAggregationMdid;
53

    
54
	@Column(name = "last_download_total")
55
	private Integer lastDownloadTotal;
56
	@Column(name = "last_download_date")
57
	private Date lastDownloadDate;
58
	@Column(name = "last_download_objid")
59
	private String lastDownloadMdid;
60

    
61
	@Column(name = "last_validation_job")
62
	private String lastValidationJob;
63

    
64
	private String baseurl = null;
65

    
66
	@OneToMany(mappedBy="api", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
67
	private Set<Apiparam> apiparam;
68

    
69
	public String getId() {
70
		return id;
71
	}
72

    
73
	public String getProtocol() {
74
		return protocol;
75
	}
76

    
77
	public Datasource getDatasource() {
78
		return datasource;
79
	}
80

    
81
	public String getContentdescription() {
82
		return contentdescription;
83
	}
84

    
85
	public Boolean getActive() {
86
		return active;
87
	}
88

    
89
	public Boolean getRemovable() {
90
		return removable;
91
	}
92

    
93
	public String getTypology() {
94
		return typology;
95
	}
96

    
97
	public String getCompatibility() {
98
		return compatibility;
99
	}
100

    
101
	public String getMetadataIdentifierPath() {
102
		return metadataIdentifierPath;
103
	}
104

    
105
	public Integer getLastCollectionTotal() {
106
		return lastCollectionTotal;
107
	}
108

    
109
	public Date getLastCollectionDate() {
110
		return lastCollectionDate;
111
	}
112

    
113
	public String getLastCollectionMdid() {
114
		return lastCollectionMdid;
115
	}
116

    
117
	public Integer getLastAggregationTotal() {
118
		return lastAggregationTotal;
119
	}
120

    
121
	public Date getLastAggregationDate() {
122
		return lastAggregationDate;
123
	}
124

    
125
	public String getLastAggregationMdid() {
126
		return lastAggregationMdid;
127
	}
128

    
129
	public Integer getLastDownloadTotal() {
130
		return lastDownloadTotal;
131
	}
132

    
133
	public Date getLastDownloadDate() {
134
		return lastDownloadDate;
135
	}
136

    
137
	public String getLastDownloadMdid() {
138
		return lastDownloadMdid;
139
	}
140

    
141
	public String getLastValidationJob() {
142
		return lastValidationJob;
143
	}
144

    
145
	public String getBaseurl() {
146
		return baseurl;
147
	}
148

    
149
	public Set<Apiparam> getApiparam() {
150
		return apiparam;
151
	}
152

    
153
	public Api setId(final String id) {
154
		this.id = id;
155
		return this;
156
	}
157

    
158
	public Api setProtocol(final String protocol) {
159
		this.protocol = protocol;
160
		return this;
161
	}
162

    
163
	public Api setDatasource(final Datasource datasource) {
164
		this.datasource = datasource;
165
		return this;
166
	}
167

    
168
	public Api setContentdescription(final String contentdescription) {
169
		this.contentdescription = contentdescription;
170
		return this;
171
	}
172

    
173
	public Api setActive(final Boolean active) {
174
		this.active = active;
175
		return this;
176
	}
177

    
178
	public Api setRemovable(final Boolean removable) {
179
		this.removable = removable;
180
		return this;
181
	}
182

    
183
	public Api setTypology(final String typology) {
184
		this.typology = typology;
185
		return this;
186
	}
187

    
188
	public Api setCompatibility(final String compatibility) {
189
		this.compatibility = compatibility;
190
		return this;
191
	}
192

    
193
	public Api setMetadataIdentifierPath(final String metadataIdentifierPath) {
194
		this.metadataIdentifierPath = metadataIdentifierPath;
195
		return this;
196
	}
197

    
198
	public Api setLastCollectionTotal(final Integer lastCollectionTotal) {
199
		this.lastCollectionTotal = lastCollectionTotal;
200
		return this;
201
	}
202

    
203
	public Api setLastCollectionDate(final Date lastCollectionDate) {
204
		this.lastCollectionDate = lastCollectionDate;
205
		return this;
206
	}
207

    
208
	public Api setLastCollectionMdid(final String lastCollectionMdid) {
209
		this.lastCollectionMdid = lastCollectionMdid;
210
		return this;
211
	}
212

    
213
	public Api setLastAggregationTotal(final Integer lastAggregationTotal) {
214
		this.lastAggregationTotal = lastAggregationTotal;
215
		return this;
216
	}
217

    
218
	public Api setLastAggregationDate(final Date lastAggregationDate) {
219
		this.lastAggregationDate = lastAggregationDate;
220
		return this;
221
	}
222

    
223
	public Api setLastAggregationMdid(final String lastAggregationMdid) {
224
		this.lastAggregationMdid = lastAggregationMdid;
225
		return this;
226
	}
227

    
228
	public Api setLastDownloadTotal(final Integer lastDownloadTotal) {
229
		this.lastDownloadTotal = lastDownloadTotal;
230
		return this;
231
	}
232

    
233
	public Api setLastDownloadDate(final Date lastDownloadDate) {
234
		this.lastDownloadDate = lastDownloadDate;
235
		return this;
236
	}
237

    
238
	public Api setLastDownloadMdid(final String lastDownloadMdid) {
239
		this.lastDownloadMdid = lastDownloadMdid;
240
		return this;
241
	}
242

    
243
	public Api setLastValidationJob(final String lastValidationJob) {
244
		this.lastValidationJob = lastValidationJob;
245
		return this;
246
	}
247

    
248
	public Api setBaseurl(final String baseurl) {
249
		this.baseurl = baseurl;
250
		return this;
251
	}
252

    
253
	public Api setApiparam(final Set<Apiparam> apiparam) {
254
		this.apiparam = apiparam;
255
		return this;
256
	}
257

    
258
	@Override
259
	public boolean equals(Object o) {
260
		if (this == o) {
261
			return true;
262
		}
263
		if (o == null || getClass() != o.getClass()) {
264
			return false;
265
		}
266
		Api api = (Api) o;
267
		return Objects.equals(this.id, api.id);
268
	}
269

    
270
	@Override
271
	public int hashCode() {
272
		return Objects.hash(id);
273
	}
274

    
275
	@Override
276
	public String toString() {
277
		return new Gson().toJson(this);
278
	}
279

    
280
}
281

    
(1-1/7)