01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/msgcntr/trunk/messageforums-hbm/src/java/org/sakaiproject/component/app/messageforums/dao/hibernate/LabelImpl.java $
03: * $Id: LabelImpl.java 9227 2006-05-15 15:02:42Z cwen@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.component.app.messageforums.dao.hibernate;
21:
22: import org.apache.commons.logging.Log;
23: import org.apache.commons.logging.LogFactory;
24: import org.sakaiproject.api.app.messageforums.DiscussionForum;
25: import org.sakaiproject.api.app.messageforums.DiscussionTopic;
26: import org.sakaiproject.api.app.messageforums.Label;
27:
28: public class LabelImpl extends MutableEntityImpl implements Label {
29:
30: private static final Log LOG = LogFactory.getLog(LabelImpl.class);
31:
32: private String key;
33: private String value;
34:
35: // foreign keys for hibernate
36: private DiscussionForum discussionForum;
37: private DiscussionTopic discussionTopic;
38:
39: // indecies for hibernate
40: private int dtindex;
41: private int dfindex;
42:
43: public DiscussionForum getDiscussionForum() {
44: return discussionForum;
45: }
46:
47: public void setDiscussionForum(DiscussionForum discussionForum) {
48: this .discussionForum = discussionForum;
49: }
50:
51: public String getKey() {
52: return key;
53: }
54:
55: public void setKey(String key) {
56: this .key = key;
57: }
58:
59: public String getValue() {
60: return value;
61: }
62:
63: public void setValue(String value) {
64: this .value = value;
65: }
66:
67: public DiscussionTopic getDiscussionTopic() {
68: return discussionTopic;
69: }
70:
71: public void setDiscussionTopic(DiscussionTopic discussionTopic) {
72: this .discussionTopic = discussionTopic;
73: }
74:
75: public int getDfindex() {
76: try {
77: return getDiscussionForum().getLabels().indexOf(this );
78: } catch (Exception e) {
79: return dfindex;
80: }
81: }
82:
83: public void setDfindex(int dfindex) {
84: this .dfindex = dfindex;
85: }
86:
87: public int getDtindex() {
88: try {
89: return getDiscussionTopic().getLabels().indexOf(this );
90: } catch (Exception e) {
91: return dtindex;
92: }
93: }
94:
95: public void setDtindex(int dtindex) {
96: this.dtindex = dtindex;
97: }
98:
99: }
|