1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.bo;
17
18 import javax.persistence.Column;
19 import javax.persistence.Entity;
20 import javax.persistence.Id;
21 import javax.persistence.Table;
22 import javax.persistence.Transient;
23 import javax.persistence.UniqueConstraint;
24
25 import org.eclipse.persistence.annotations.Index;
26 import org.kuali.rice.core.api.exception.RiceRuntimeException;
27 import org.kuali.rice.kew.api.WorkflowDocument;
28
29
30
31
32
33
34
35
36 @Entity
37 @Table(name="KRNS_DOC_HDR_T",uniqueConstraints= {
38 @UniqueConstraint(name="KRNS_DOC_HDR_TC0",columnNames="OBJ_ID")
39 })
40 public class DocumentHeader extends PersistableBusinessObjectBase {
41 private static final long serialVersionUID = 2302690966928882488L;
42
43 @Id
44 @Column(name="DOC_HDR_ID",length=14)
45 protected String documentNumber;
46 @Column(name="FDOC_DESC",length=255)
47 protected String documentDescription;
48
49 @Index(name="KRNS_DOC_HDR_TI3")
50 @Column(name="ORG_DOC_HDR_ID",length=10)
51 protected String organizationDocumentNumber;
52 @Column(name="TMPL_DOC_HDR_ID",length=14)
53 protected String documentTemplateNumber;
54 @Column(name="EXPLANATION",length=400)
55 protected String explanation;
56
57 @Transient
58 private WorkflowDocument workflowDocument;
59
60
61
62
63
64 public DocumentHeader() {
65 super();
66 }
67
68
69
70
71
72
73 public WorkflowDocument getWorkflowDocument() {
74 if (workflowDocument == null) {
75 throw new RiceRuntimeException("The workflow document is null. This indicates that the DocumentHeader has not been initialized properly. This can be caused by not retrieving a document using the DocumentService.");
76 }
77
78 return workflowDocument;
79 }
80
81
82
83
84
85 public boolean hasWorkflowDocument() {
86 return (workflowDocument != null);
87 }
88
89
90
91
92
93
94 public void setWorkflowDocument(WorkflowDocument workflowDocument) {
95 this.workflowDocument = workflowDocument;
96 }
97
98
99
100
101
102 public String getDocumentNumber() {
103 return this.documentNumber;
104 }
105
106
107
108
109
110 public void setDocumentNumber(String documentNumber) {
111 this.documentNumber = documentNumber;
112 }
113
114
115
116
117
118 public String getDocumentDescription() {
119 return this.documentDescription;
120 }
121
122
123
124
125
126 public void setDocumentDescription(String documentDescription) {
127 this.documentDescription = documentDescription;
128 }
129
130
131
132
133
134 public String getOrganizationDocumentNumber() {
135 return this.organizationDocumentNumber;
136 }
137
138
139
140
141
142 public void setOrganizationDocumentNumber(String organizationDocumentNumber) {
143 this.organizationDocumentNumber = organizationDocumentNumber;
144 }
145
146
147
148
149
150 public String getDocumentTemplateNumber() {
151 return this.documentTemplateNumber;
152 }
153
154
155
156
157
158 public void setDocumentTemplateNumber(String documentTemplateNumber) {
159 this.documentTemplateNumber = documentTemplateNumber;
160 }
161
162
163
164
165
166 public String getExplanation() {
167 return explanation;
168 }
169
170
171
172
173
174 public void setExplanation(String explanation) {
175 this.explanation = explanation;
176 }
177
178 }