View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.bo;
17  
18  import javax.persistence.Column;
19  import javax.persistence.Embeddable;
20  import javax.persistence.Lob;
21  import javax.persistence.MappedSuperclass;
22  
23  
24  /**
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  @MappedSuperclass
28  public class PersistableAttachmentBase extends PersistableBusinessObjectBase implements PersistableAttachment {
29  
30      /**
31       * EclipseLink static weaving does not weave MappedSuperclass unless an Entity or Embedded is
32       * weaved which uses it, hence this class.
33       */
34      @Embeddable
35      private static final class WeaveMe extends PersistableAttachmentBase {}
36  
37      @Lob
38  	@Column(name = "ATT_CNTNT")
39      private byte[] attachmentContent;
40  
41  	@Column(name = "FILE_NM", length = 150)
42      private String fileName;
43  
44  	@Column(name = "CNTNT_TYP", length = 255)
45      private String contentType;
46  
47      @Override
48      public byte[] getAttachmentContent() {
49          return this.attachmentContent;
50      }
51  
52      @Override
53      public void setAttachmentContent(byte[] attachmentContent) {
54          this.attachmentContent = attachmentContent;
55      }
56  
57  
58      @Override
59      public String getFileName() {
60          return fileName;
61      }
62  
63  
64      @Override
65      public void setFileName(String fileName) {
66          this.fileName = fileName;
67      }
68  
69  
70      @Override
71      public String getContentType() {
72          return contentType;
73      }
74  
75  
76      @Override
77      public void setContentType(String contentType) {
78          this.contentType = contentType;
79      }
80  }