1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.opencastproject.oaipmh.persistence;
22
23 import javax.persistence.Column;
24 import javax.persistence.Entity;
25 import javax.persistence.GeneratedValue;
26 import javax.persistence.Id;
27 import javax.persistence.JoinColumn;
28 import javax.persistence.JoinColumns;
29 import javax.persistence.Lob;
30 import javax.persistence.ManyToOne;
31 import javax.persistence.Table;
32
33 @Entity(name = "OaiPmhElementEntity")
34 @Table(name = "oc_oaipmh_elements")
35 public class OaiPmhElementEntity {
36
37
38 @Id
39 @GeneratedValue
40 @Column(name = "id")
41 private long id;
42
43
44 @Column(name = "element_type", length = 16, nullable = false)
45 private String elementType;
46
47
48 @Column(name = "flavor", nullable = false)
49 private String flavor;
50
51
52 @Lob
53 @Column(name = "xml", length = 65535, nullable = false)
54 private String xml;
55
56
57 @ManyToOne(optional = false)
58 @JoinColumns({
59 @JoinColumn(name = "mp_id", referencedColumnName = "mp_id", nullable = false, table = "oc_oaipmh_elements"),
60 @JoinColumn(name = "organization", referencedColumnName = "organization", nullable = false, table = "oc_oaipmh_elements"),
61 @JoinColumn(name = "repo_id", referencedColumnName = "repo_id", nullable = false, table = "oc_oaipmh_elements")
62 })
63 private OaiPmhEntity oaiPmhEntity;
64
65 public OaiPmhElementEntity() { }
66
67
68
69
70
71
72
73
74 public OaiPmhElementEntity(String elementType, String flavor, String xml) {
75 this.elementType = elementType;
76 this.flavor = flavor;
77 this.xml = xml;
78 }
79
80
81
82
83 public String getElementType() {
84 return elementType;
85 }
86
87
88
89
90
91 public void setElementType(String elementType) {
92 this.elementType = elementType;
93 }
94
95
96
97
98 public String getFlavor() {
99 return flavor;
100 }
101
102
103
104
105 public void setFlavor(String flavor) {
106 this.flavor = flavor;
107 }
108
109
110
111
112 public String getXml() {
113 return xml;
114 }
115
116
117
118
119 public void setXml(String xml) {
120 this.xml = xml;
121 }
122
123
124
125
126 public OaiPmhEntity getOaiPmhEntity() {
127 return oaiPmhEntity;
128 }
129
130
131
132
133 public void setOaiPmhEntity(OaiPmhEntity oaiPmhEntity) {
134 this.oaiPmhEntity = oaiPmhEntity;
135 }
136 }