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 MCRCATEGPK implements Serializable {
032    
033        private static final long serialVersionUID = -2883097610006670647L;
034    
035        public String id;
036    
037        public String clid;
038    
039        public MCRCATEGPK() {
040        }
041    
042        public MCRCATEGPK(String id, String clid) {
043            this.id = id;
044            this.clid = clid;
045        }
046    
047        /**
048         * @return Returns the cLID.
049         */
050        public String getClid() {
051            return clid;
052        }
053    
054        /**
055         * @param clid
056         *            The cLID to set.
057         */
058        public void setClid(String clid) {
059            this.clid = clid;
060        }
061    
062        /**
063         * @return Returns the iD.
064         */
065        public String getId() {
066            return id;
067        }
068    
069        /**
070         * @param id
071         *            The iD to set.
072         */
073        public void setId(String id) {
074            this.id = id;
075        }
076    
077        public boolean equals(Object other) {
078            if (!(other instanceof MCRCATEGPK)) {
079                return false;
080            }
081    
082            MCRCATEGPK castother = (MCRCATEGPK) other;
083    
084            return new EqualsBuilder().append(this.getClid(), castother.getClid()).append(this.getId(), castother.getId()).isEquals();
085        }
086    
087        public int hashCode() {
088            return new HashCodeBuilder().append(getClid()).append(getId()).toHashCode();
089        }
090    }