KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > communication > message > impl > AttachmentImpl


1 /*
2  * Copyright 2001-2003 The eXo platform SARL All rights reserved.
3  * Please look at license.txt in info directory for more license detail.
4  */

5
6 package org.exoplatform.services.communication.message.impl;
7
8 import org.exoplatform.services.communication.message.Attachment;
9
10 /**
11  * Created y the eXo platform team
12  * User: Benjamin Mestrallet
13  * Date: 2 sept. 2004
14  *
15  * @hibernate.class table="EXO_MESSAGE_ATTACHMENT"
16  * @hibernate.cache usage="read-write"
17  */

18 public class AttachmentImpl implements Attachment{
19
20   private String JavaDoc id;
21   private String JavaDoc messageId_;
22   private String JavaDoc folderId_ ;
23   private String JavaDoc name_;
24   private byte[] content_;
25
26   /**
27    * @hibernate.id generator-class="assigned"
28    **/

29   public String JavaDoc getId() { return id; }
30   public void setId(String JavaDoc id) { this.id = id; }
31
32   /**
33    * @hibernate.property
34    **/

35   public String JavaDoc getMessageId() { return messageId_; }
36   public void setMessageId(String JavaDoc messageId) { this.messageId_ = messageId; }
37   
38   /**
39    * @hibernate.property
40    **/

41   public String JavaDoc getFolderId() { return folderId_; }
42   public void setFolderId(String JavaDoc folderId) { folderId_ = folderId; }
43  
44   /**
45    * @hibernate.property
46    **/

47   public String JavaDoc getName() { return name_; }
48   public void setName(String JavaDoc name) { this.name_ = name; }
49
50   /**
51    * @hibernate.property type="binary"
52    **/

53   public byte[] getContent() { return content_; }
54   public void setContent(byte[] content) { this.content_ = content; }
55   
56   public Attachment cloneAttachment() {
57     AttachmentImpl newAttachment = new AttachmentImpl() ;
58     newAttachment.setName(getName()) ;
59     newAttachment.setContent(getContent()) ;
60     return newAttachment ;
61   }
62 }
Popular Tags