IndexedPublisher.java
1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package org.legrog.entities;
import org.apache.solr.client.solrj.beans.Field;
import javax.persistence.Id;
import javax.persistence.Lob;
/**
* Simplified class for indexing and searching validated publishers: content from PublisherVersion with id from Publisher
*/
public class IndexedPublisher {
@Id
@Field
private Integer publisherId;
@Field
private String publisherName;
@Lob
@Field
private String publisherHistory;
/**
* Extracts data needed for indexing from Publisher and its validated PublisherVersion
*
* @param publisher Publisher we want to be indexed
*/
public IndexedPublisher(Publisher publisher) {
PublisherVersion publisherVersion = publisher.getValidatedVersion();
this.publisherId = publisher.getPublisherId();
this.publisherName = publisherVersion.getPublisherName();
this.publisherHistory = publisherVersion.getPublisherHistory();
}
public IndexedPublisher() {
//no args constructor to make it proxyable
}
public Integer getPublisherId() {
return publisherId;
}
public String getPublisherName() {
return publisherName;
}
public String getPublisherHistory() {
return publisherHistory;
}
public void setPublisherId(Integer publisherId) {
this.publisherId = publisherId;
}
public void setPublisherName(String publisherName) {
this.publisherName = publisherName;
}
public void setPublisherHistory(String publisherHistory) {
this.publisherHistory = publisherHistory;
}
}