001    /*
002     * 
003     * $Revision: 13085 $ $Date: 2008-02-06 18:27:24 +0100 (Mi, 06 Feb 2008) $
004     *
005     * This file is part of ***  M y C o R e  ***
006     * See http://www.mycore.de/ for details.
007     *
008     * This program is free software; you can use it, redistribute it
009     * and / or modify it under the terms of the GNU General Public License
010     * (GPL) as published by the Free Software Foundation; either version 2
011     * of the License or (at your option) any later version.
012     *
013     * This program is distributed in the hope that it will be useful, but
014     * WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016     * GNU General Public License for more details.
017     *
018     * You should have received a copy of the GNU General Public License
019     * along with this program, in a file called gpl.txt or license.txt.
020     * If not, write to the Free Software Foundation Inc.,
021     * 59 Temple Place - Suite 330, Boston, MA  02111-1307 USA
022     */
023    
024    package org.mycore.backend.hibernate.tables;
025    
026    import java.io.Serializable;
027    
028    import org.apache.commons.lang.builder.EqualsBuilder;
029    import org.apache.commons.lang.builder.HashCodeBuilder;
030    
031    public class MCRGROUPMEMBERSPK implements Serializable {
032        private static final long serialVersionUID = 4308033318842963890L;
033    
034        public long id;
035    
036        private MCRGROUPS gid;
037    
038        private MCRUSERS userid;
039    
040        public MCRGROUPMEMBERSPK() {
041        }
042    
043        public MCRGROUPMEMBERSPK(MCRGROUPS gid, MCRUSERS userid) {
044            this.gid = gid;
045            this.userid = userid;
046        }
047    
048        public MCRGROUPMEMBERSPK(long id) {
049            this.id = id;
050        }
051    
052        /**
053         * @return Returns the gid.
054         */
055        public MCRGROUPS getGid() {
056            return gid;
057        }
058    
059        /**
060         * @param gid
061         *            The gid to set.
062         */
063        public void setGid(MCRGROUPS gid) {
064            this.gid = gid;
065        }
066    
067        /**
068         * @return Returns the userid.
069         */
070        public MCRUSERS getUserid() {
071            return userid;
072        }
073    
074        /**
075         * @param userid
076         *            The userid to set.
077         */
078        public void setUserid(MCRUSERS userid) {
079            this.userid = userid;
080        }
081    
082        public boolean equals(Object other) {
083            if (!(other instanceof MCRGROUPMEMBERSPK)) {
084                return false;
085            }
086    
087            MCRGROUPMEMBERSPK castother = (MCRGROUPMEMBERSPK) other;
088    
089            return new EqualsBuilder().append(this.getGid(), castother.getGid()).append(this.getUserid(), castother.getUserid()).isEquals();
090        }
091    
092        public int hashCode() {
093            return new HashCodeBuilder().append(getGid()).append(getUserid()).toHashCode();
094        }
095    }