001 /*
002 *
003 * $Revision: 14589 $ $Date: 2009-01-14 15:17:28 +0100 (Wed, 14 Jan 2009) $
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.sql.Blob;
027 import java.util.Date;
028
029 import org.mycore.datamodel.common.MCRObjectIDDate;
030
031 public class MCRXMLTABLE implements MCRObjectIDDate {
032 private MCRXMLTABLEPK key;
033
034 private String type;
035
036 private Blob xml;
037
038 private Date lastModified;
039
040 public MCRXMLTABLE() {
041 this.key = new MCRXMLTABLEPK();
042 }
043
044 public MCRXMLTABLE(String id, int version, String type, Blob xml) {
045 this.key = new MCRXMLTABLEPK(id, version);
046 this.type = type;
047 this.xml = xml;
048 }
049
050 public MCRXMLTABLEPK getKey() {
051 return key;
052 }
053
054 public void setKey(MCRXMLTABLEPK key) {
055 this.key = key;
056 }
057
058 /* (non-Javadoc)
059 * @see org.mycore.backend.hibernate.tables.MCRObjectIDDate#getId()
060 */
061 public String getId() {
062 return this.key.getId();
063 }
064
065 public void setId(String id) {
066 this.key.setId(id);
067 }
068
069 public int getVersion() {
070 return this.key.getVersion();
071 }
072
073 public void setVersion(int version) {
074 this.key.setVersion(version);
075 }
076
077 public String getType() {
078 return type;
079 }
080
081 public void setType(String type) {
082 this.type = type;
083 }
084
085 public byte[] getXmlByteArray() {
086 return MCRBlob.getBytes(this.xml);
087 }
088
089 public Blob getXml() {
090 return xml;
091 }
092
093 public void setXml(Blob xml) {
094 this.xml = xml;
095 }
096
097 public void setXmlByteArray(byte[] xml) {
098 this.xml = new MCRBlob(xml);
099 }
100
101 /* (non-Javadoc)
102 * @see org.mycore.backend.hibernate.tables.MCRObjectIDDate#getLastModified()
103 */
104 public Date getLastModified() {
105 return lastModified;
106 }
107
108 public void setLastModified(Date lastModified) {
109 this.lastModified = lastModified;
110 }
111 }