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 org.mycore.common.MCRPersistenceException;
027    
028    public class MCRCATEG {
029        private MCRCATEGPK key;
030    
031        private String pid;
032    
033        private String url;
034    
035        public MCRCATEG() {
036            this.key = new MCRCATEGPK();
037        }
038    
039        public MCRCATEG(String id, String clid, String pid, String url) throws MCRPersistenceException {
040            if ((id == null) || (id.trim().length() == 0) || (clid == null) || (clid.trim().length() == 0)) {
041                throw new MCRPersistenceException("The label of a category has an empty ID, CLID or lang element.");
042                }
043            this.key = new MCRCATEGPK(id, clid);
044            this.pid = pid;
045            this.url = url;
046        }
047    
048        /**
049         * @hibernate.property columns="PRIMARY KEY" not-null="true" update="true"
050         */
051        public MCRCATEGPK getKey() {
052            return key;
053        }
054    
055        public void setKey(MCRCATEGPK key) {
056            this.key = key;
057        }
058    
059        /**
060         * @hibernate.property columns="CLID" not-null="true" update="true"
061         */
062        public String getClid() {
063            return key.getClid();
064        }
065    
066        public void setClid(String clid) {
067            key.setClid(clid);
068        }
069    
070        /**
071         * @hibernate.property columns="ID" not-null="true" update="true"
072         */
073        public String getId() {
074            return key.getId();
075        }
076    
077        public void setId(String id) {
078            key.setId(id);
079        }
080    
081        /**
082         * @hibernate.property column="PID" not-null="true" update="true"
083         */
084        public String getPid() {
085            return pid;
086        }
087    
088        public void setPid(String pid) {
089            this.pid = pid;
090        }
091    
092        /**
093         * @hibernate.property column="URL" not-null="true" update="true"
094         */
095        public String getUrl() {
096            return url;
097        }
098    
099        public void setUrl(String url) {
100            this.url = url;
101        }
102    }