001: /*
002: * Coefficient - facilitates project based collaboration
003: * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
004: * PO Box 395
005: * Pretoria 0001, RSA
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or (at your option) any later version.
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: */
019:
020: package za.org.coefficient.authentication;
021:
022: /**
023: * Title: Project Engine
024: * Description: Memeber containing a CoefficientUser and a Role, created by projects
025: * Copyright: Copyright (c) 2003
026: * Company: icomtek CSIR
027: * @author Dylan Etkin
028: * @version 1.0
029: * @hibernate.class
030: * table="COEFFICIENT_PROJECT_MEMBER"
031: */
032: public class ProjectMember implements java.io.Serializable {
033: //~ Instance fields ========================================================
034:
035: private CoefficientUser coefficientUser;
036: private Long id;
037: private Role projectRole;
038: private long version;
039:
040: //~ Constructors ===========================================================
041:
042: public ProjectMember() {
043: }
044:
045: public ProjectMember(CoefficientUser user, Role projectRole) {
046: this .coefficientUser = user;
047: this .projectRole = projectRole;
048: }
049:
050: //~ Methods ================================================================
051:
052: public void setId(Long id) {
053: this .id = id;
054: }
055:
056: /**
057: * @hibernate.id
058: * generator-class="native"
059: */
060: public Long getId() {
061: return id;
062: }
063:
064: /**
065: * Sets the value of user
066: *
067: * @param user Value to assign to this.user
068: */
069: public void setCoefficientUser(CoefficientUser user) {
070: this .coefficientUser = user;
071: }
072:
073: /**
074: * Gets the value of user
075: *
076: * @return the value of user
077: * @hibernate.many-to-one
078: * column="COEFFICIENT_USER"
079: */
080: public CoefficientUser getCoefficientUser() {
081: return this .coefficientUser;
082: }
083:
084: /**
085: * Sets the value of projectRole
086: *
087: * @param argProjectRole Value to assign to this.projectRole
088: */
089: public void setProjectRole(Role argProjectRole) {
090: this .projectRole = argProjectRole;
091: }
092:
093: /**
094: * Gets the value of projectRole
095: *
096: * @return the value of projectRole
097: * @hibernate.many-to-one
098: * column="PROJECT_ROLE"
099: */
100: public Role getProjectRole() {
101: return this .projectRole;
102: }
103:
104: /**
105: * Sets the value of version
106: *
107: * @param version Value to assign to this.version
108: */
109: public void setVersion(long version) {
110: this .version = version;
111: }
112:
113: /**
114: * Gets the value of version
115: *
116: * @return the value of version
117: * @hibernate.version
118: * column="VERSION"
119: * type="long"
120: */
121: public long getVersion() {
122: return this .version;
123: }
124:
125: public boolean equals(Object other) {
126: ProjectMember o = (ProjectMember) other;
127:
128: return (this != null)
129: && (o != null)
130: && (((projectRole == null) && (o.projectRole == null)) || projectRole
131: .equals(o.projectRole))
132: && (((coefficientUser == null) && (o.coefficientUser == null)) || coefficientUser
133: .equals(o.coefficientUser));
134: }
135: }
|