Project

General

Profile

« Previous | Next » 

Revision 45460

View differences:

Publication.java
1 1
package eu.dnetlib.goldoa.domain;
2 2

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

  
3 5
import java.io.Serializable;
4 6
import javax.persistence.*;
5 7

  
......
13 15
 * 
14 16
 */
15 17
@Entity
16
@NamedQuery(name="Publication.findAll", query="SELECT p FROM Publication p")
17 18
public class Publication implements Serializable {
18 19
	private static final long serialVersionUID = 1L;
19 20

  
21
	public enum Type implements IsSerializable {
22
		ARTICLE("article"),
23
		MONOGRAPH("monograph"),
24
		BOOK_CHAPTER("book chapter"),
25
		CONFERENCE_PROCS("Conference Procs");
26

  
27
		private String type;
28

  
29
		Type(String type) {
30
			this.type = type;
31
		}
32

  
33
		public String getType() {
34
			return type;
35
		}
36
	}
37

  
38

  
20 39
	@Temporal(TemporalType.DATE)
21 40
	private Date acceptancedate;
22 41
	
......
63 82
	private String title;
64 83

  
65 84
	//@Column(columnDefinition = "text")
66
	private String type;
85
	@Enumerated(EnumType.STRING)
86
	private Type type;
67 87

  
68
	//@OneToMany(mappedBy = "publication",cascade=CascadeType.ALL)
69 88
	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "publications")
70 89
	private List<Affiliation> affiliations = new ArrayList<>();
71
	
90

  
91
	@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
92
	@JoinTable(name = "publication_author",  joinColumns = {
93
			@JoinColumn(name = "author", nullable = false, updatable = false)
94
			},
95
			inverseJoinColumns = { @JoinColumn(name = "email",
96
					nullable = false, updatable = false) })
97
	private List<Author> authors = new ArrayList<>();
98

  
72 99
	@OneToMany(mappedBy = "publication",cascade=CascadeType.ALL)
73
	private List<Publication_Author> publicationAuthor = new ArrayList<>();
74
	
75
	
100
	private List<Identifier> publicationIdentifiers = new ArrayList<>();
101

  
76 102
	public Publication() {
77 103
	}
78 104

  
......
196 222
		this.title = title;
197 223
	}
198 224

  
199
	public String getType() {
225
	public Type getType() {
200 226
		return this.type;
201 227
	}
202 228

  
203
	public void setType(String type) {
229
	public void setType(Type type) {
204 230
		this.type = type;
205 231
	}
206 232

  
233
	public List<Identifier> getPublicationIdentifiers() {
234
		return publicationIdentifiers;
235
	}
236

  
237
	public void setPublicationIdentifiers(List<Identifier> publicationIdentifiers) {
238
		this.publicationIdentifiers = publicationIdentifiers;
239
	}
240

  
241
	public void addIdentifier(Identifier i){
242
		this.publicationIdentifiers.add(i);
243
	}
244

  
245
	public void removeIdentifier(Identifier i){
246
		this.publicationIdentifiers.remove(i);
247
	}
248

  
249
	public List<Affiliation> getAffiliations() {
250
		return affiliations;
251
	}
252

  
253
	public void setAffiliations(List<Affiliation> affiliations) {
254
		this.affiliations = affiliations;
255
	}
256

  
257
	public List<Author> getAuthors() {
258
		return authors;
259
	}
260

  
261
	public void setAuthors(List<Author> authors) {
262
		this.authors = authors;
263
	}
264

  
265

  
207 266
}

Also available in: Unified diff