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    public class MCRACCESSPK implements Serializable {
029    
030        private static final long serialVersionUID = 1177905976922683366L;
031    
032        private String acpool;
033    
034        private String objid;
035    
036        public MCRACCESSPK() {
037        }
038    
039        public MCRACCESSPK(String acpool, String objid) {
040            this.acpool = acpool;
041            this.objid = objid;
042        }
043    
044        public String getAcpool() {
045            return acpool;
046        }
047    
048        public void setAcpool(String acpool) {
049            this.acpool = acpool;
050        }
051    
052        public String getObjid() {
053            return objid;
054        }
055    
056        public void setObjid(String objid) {
057            this.objid = objid;
058        }
059    
060        /* (non-Javadoc)
061         * @see java.lang.Object#hashCode()
062         */
063        @Override
064        public int hashCode() {
065            final int PRIME = 31;
066            int result = 1;
067            result = PRIME * result + ((acpool == null) ? 0 : acpool.hashCode());
068            result = PRIME * result + ((objid == null) ? 0 : objid.hashCode());
069            return result;
070        }
071    
072        /* (non-Javadoc)
073         * @see java.lang.Object#equals(java.lang.Object)
074         */
075        @Override
076        public boolean equals(Object obj) {
077            if (this == obj)
078                return true;
079            if (obj == null)
080                return false;
081            if (getClass() != obj.getClass())
082                return false;
083            final MCRACCESSPK other = (MCRACCESSPK) obj;
084            if (acpool == null) {
085                if (other.acpool != null)
086                    return false;
087            } else if (!acpool.equals(other.acpool))
088                return false;
089            if (objid == null) {
090                if (other.objid != null)
091                    return false;
092            } else if (!objid.equals(other.objid))
093                return false;
094            return true;
095        }
096    
097    }