001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/msgcntr/trunk/messageforums-hbm/src/java/org/sakaiproject/component/app/messageforums/dao/hibernate/AttachmentImpl.java $
003: * $Id: AttachmentImpl.java 9227 2006-05-15 15:02:42Z cwen@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.component.app.messageforums.dao.hibernate;
021:
022: import org.apache.commons.logging.Log;
023: import org.apache.commons.logging.LogFactory;
024: import org.sakaiproject.api.app.messageforums.Attachment;
025: import org.sakaiproject.api.app.messageforums.BaseForum;
026: import org.sakaiproject.api.app.messageforums.Message;
027: import org.sakaiproject.api.app.messageforums.OpenForum;
028: import org.sakaiproject.api.app.messageforums.PrivateForum;
029: import org.sakaiproject.api.app.messageforums.Topic;
030:
031: public class AttachmentImpl extends MutableEntityImpl implements
032: Attachment {
033:
034: private static final Log LOG = LogFactory
035: .getLog(AttachmentImpl.class);
036:
037: private String attachmentId;
038:
039: private String attachmentUrl;
040:
041: private String attachmentName;
042:
043: private String attachmentSize;
044:
045: private String attachmentType;
046:
047: private Long pvtMsgAttachId;
048:
049: // foreign keys for hibernate
050: private Message message;
051: private BaseForum forum;
052: private Topic topic;
053: private OpenForum openForum;
054: private PrivateForum privateForum;
055:
056: // indecies for hibernate
057: // private int mesindex;
058: // private int ofindex;
059: // private int pfindex;
060: // private int tindex;
061:
062: public String getAttachmentId() {
063: return attachmentId;
064: }
065:
066: public void setAttachmentId(String attachmentId) {
067: this .attachmentId = attachmentId;
068: }
069:
070: public String getAttachmentName() {
071: return attachmentName;
072: }
073:
074: public void setAttachmentName(String attachmentName) {
075: this .attachmentName = attachmentName;
076: }
077:
078: public String getAttachmentSize() {
079: return attachmentSize;
080: }
081:
082: public void setAttachmentSize(String attachmentSize) {
083: this .attachmentSize = attachmentSize;
084: }
085:
086: public String getAttachmentType() {
087: return attachmentType;
088: }
089:
090: public void setAttachmentType(String attachmentType) {
091: this .attachmentType = attachmentType;
092: }
093:
094: public String getAttachmentUrl() {
095: return attachmentUrl;
096: }
097:
098: public void setAttachmentUrl(String attachmentUrl) {
099: this .attachmentUrl = attachmentUrl;
100: }
101:
102: public Message getMessage() {
103: return message;
104: }
105:
106: public void setMessage(Message message) {
107: this .message = message;
108: }
109:
110: // public boolean equals(Object other) {
111: // if (!(other instanceof AttachmentImpl)) {
112: // return false;
113: // }
114: //
115: // Attachment attachment = (Attachment) other;
116: // return new EqualsBuilder().append(attachmentId, attachment.getAttachmentId()).isEquals();
117: // }
118: //
119: // public int hashCode() {
120: // return new HashCodeBuilder().append(attachmentId).toHashCode();
121: // }
122: //
123: // public String toString() {
124: // return new ToStringBuilder(this).append("attachmentId", attachmentId).append("attachmentUrl", attachmentUrl).append("attachmentName", attachmentName).append("attachmentSize", attachmentSize).append("attachmentType", attachmentType).toString();
125: // }
126:
127: public BaseForum getForum() {
128: return forum;
129: }
130:
131: public void setForum(BaseForum forum) {
132: this .forum = forum;
133: }
134:
135: public Topic getTopic() {
136: return topic;
137: }
138:
139: public void setTopic(Topic topic) {
140: this .topic = topic;
141: }
142:
143: // public int getMesindex() {
144: // try {
145: // return getMessage().getAttachments().indexOf(this);
146: // } catch (Exception e) {
147: // return mesindex;
148: // }
149: // }
150: //
151: // public void setMesindex(int mesindex) {
152: // this.mesindex = mesindex;
153: // }
154: //
155: // public int getOfindex() {
156: // try {
157: // return getForum().getAttachments().indexOf(this);
158: // } catch (Exception e) {
159: // return ofindex;
160: // }
161: // }
162: //
163: // public void setOfindex(int ofindex) {
164: // this.ofindex = ofindex;
165: // }
166: //
167: // public int getPfindex() {
168: // try {
169: // return getForum().getAttachments().indexOf(this);
170: // } catch (Exception e) {
171: // return pfindex;
172: // }
173: // }
174: //
175: // public void setPfindex(int pfindex) {
176: // this.pfindex = pfindex;
177: // }
178: //
179: // public int getTindex() {
180: // try {
181: // return getTopic().getAttachments().indexOf(this);
182: // } catch (Exception e) {
183: // return tindex;
184: // }
185: // }
186: //
187: // public void setTindex(int tindex) {
188: // this.tindex = tindex;
189: // }
190:
191: public OpenForum getOpenForum() {
192: return openForum;
193: }
194:
195: public void setOpenForum(OpenForum openForum) {
196: this .openForum = openForum;
197: }
198:
199: public PrivateForum getPrivateForum() {
200: return privateForum;
201: }
202:
203: public void setPrivateForum(PrivateForum privateForum) {
204: this .privateForum = privateForum;
205: }
206:
207: public Long getPvtMsgAttachId() {
208: return pvtMsgAttachId;
209: }
210:
211: public void setPvtMsgAttachId(Long pvtMsgAttachId) {
212: this .pvtMsgAttachId = pvtMsgAttachId;
213: }
214:
215: public void setLastModifiedBy(String lastMOdifiedBy) {
216: // TODO Auto-generated method stub
217:
218: }
219: }
|