View Javadoc
1   /**
2    * Copyright 2005-2016 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 PersistableBusinessObjectBaseAdapter implements PersistableAttachment {
29  
30      private static final long serialVersionUID = 1L;
31  
32  
33      /**
34       * EclipseLink static weaving does not weave MappedSuperclass unless an Entity or Embedded is
35       * weaved which uses it, hence this class.
36       */
37      @Embeddable
38      private static final class WeaveMe extends PersistableAttachmentBase {}
39  
40      @Lob
41  	@Column(name = "ATT_CNTNT")
42      private byte[] attachmentContent;
43  
44  	@Column(name = "FILE_NM", length = 150)
45      private String fileName;
46  
47  	@Column(name = "CNTNT_TYP", length = 255)
48      private String contentType;
49  
50      @Override
51      public byte[] getAttachmentContent() {
52          return this.attachmentContent;
53      }
54  
55      @Override
56      public void setAttachmentContent(byte[] attachmentContent) {
57          this.attachmentContent = attachmentContent;
58      }
59  
60  
61      @Override
62      public String getFileName() {
63          return fileName;
64      }
65  
66  
67      @Override
68      public void setFileName(String fileName) {
69          this.fileName = fileName;
70      }
71  
72  
73      @Override
74      public String getContentType() {
75          return contentType;
76      }
77  
78  
79      @Override
80      public void setContentType(String contentType) {
81          this.contentType = contentType;
82      }
83  }