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,
61 table = "oc_oaipmh_elements"),
62 @JoinColumn(name = "repo_id", referencedColumnName = "repo_id", nullable = false, table = "oc_oaipmh_elements")
63 })
64 private OaiPmhEntity oaiPmhEntity;
65
66 public OaiPmhElementEntity() { }
67
68
69
70
71
72
73
74
75 public OaiPmhElementEntity(String elementType, String flavor, String xml) {
76 this.elementType = elementType;
77 this.flavor = flavor;
78 this.xml = xml;
79 }
80
81
82
83
84 public String getElementType() {
85 return elementType;
86 }
87
88
89
90
91
92 public void setElementType(String elementType) {
93 this.elementType = elementType;
94 }
95
96
97
98
99 public String getFlavor() {
100 return flavor;
101 }
102
103
104
105
106 public void setFlavor(String flavor) {
107 this.flavor = flavor;
108 }
109
110
111
112
113 public String getXml() {
114 return xml;
115 }
116
117
118
119
120 public void setXml(String xml) {
121 this.xml = xml;
122 }
123
124
125
126
127 public OaiPmhEntity getOaiPmhEntity() {
128 return oaiPmhEntity;
129 }
130
131
132
133
134 public void setOaiPmhEntity(OaiPmhEntity oaiPmhEntity) {
135 this.oaiPmhEntity = oaiPmhEntity;
136 }
137 }