001 package org.mycore.backend.hibernate.tables;
002
003 import java.io.Serializable;
004 import java.util.Date;
005 import java.sql.Blob;
006 import org.apache.commons.lang.builder.EqualsBuilder;
007 import org.apache.commons.lang.builder.HashCodeBuilder;
008 import org.apache.commons.lang.builder.ToStringBuilder;
009
010 /** @author Hibernate CodeGenerator */
011 public class MCRRESUMPTIONTOKEN implements Serializable {
012
013 private static final long serialVersionUID = 5750307015900672047L;
014
015 /** identifier field */
016 private String resumptionTokenID;
017
018 /** nullable persistent field */
019 private String prefix;
020
021 /** nullable persistent field */
022 private long completeSize;
023
024 /** nullable persistent field */
025 private Date created;
026
027 /** nullable persistent field */
028 private String instance;
029
030 /** nullable persistent field */
031 private Blob hitBlob;
032
033 /** full constructor */
034 public MCRRESUMPTIONTOKEN(String resumptionTokenID, String prefix, long completeSize, Date created, String instance, Blob hitBlob) {
035 this.resumptionTokenID = resumptionTokenID;
036 this.prefix = prefix;
037 this.completeSize = completeSize;
038 this.created = created;
039 this.instance = instance;
040 this.hitBlob = hitBlob;
041 }
042
043 /** default constructor */
044 public MCRRESUMPTIONTOKEN() {
045 }
046
047 /** minimal constructor */
048 public MCRRESUMPTIONTOKEN(String resumptionTokenID, Blob hitBlob) {
049 this.resumptionTokenID = resumptionTokenID;
050 this.hitBlob = hitBlob;
051 }
052
053 public String getResumptionTokenID() {
054 return this.resumptionTokenID;
055 }
056
057 public void setResumptionTokenID(String resumptionTokenID) {
058 this.resumptionTokenID = resumptionTokenID;
059 }
060
061 public String getPrefix() {
062 return this.prefix;
063 }
064
065 public void setPrefix(String prefix) {
066 this.prefix = prefix;
067 }
068
069 public long getCompleteSize() {
070 return this.completeSize;
071 }
072
073 public void setCompleteSize(long completeSize) {
074 this.completeSize = completeSize;
075 }
076
077 public Date getCreated() {
078 return this.created;
079 }
080
081 public void setCreated(Date created) {
082 this.created = created;
083 }
084
085 public String getInstance() {
086 return this.instance;
087 }
088
089 public void setInstance(String instance) {
090 this.instance = instance;
091 }
092
093 public Blob getHitBlob() {
094 return this.hitBlob;
095 }
096
097 public void setHitBlob(Blob hitBlob) {
098 this.hitBlob = hitBlob;
099 }
100 public byte[] getHitByteArray(){
101 return MCRBlob.getBytes(this.hitBlob);
102 }
103
104 public void setHitByteArray(byte[] hitByte) {
105 this.hitBlob = new MCRBlob(hitByte);
106 }
107
108 public String toString() {
109 return new ToStringBuilder(this)
110 .append("resumptionTokenID", getResumptionTokenID())
111 .toString();
112 }
113
114 public boolean equals(Object other) {
115 if ( !(other instanceof MCRRESUMPTIONTOKEN) ) return false;
116 MCRRESUMPTIONTOKEN castOther = (MCRRESUMPTIONTOKEN) other;
117 return new EqualsBuilder()
118 .append(this.getResumptionTokenID(), castOther.getResumptionTokenID())
119 .isEquals();
120 }
121
122 public int hashCode() {
123 return new HashCodeBuilder()
124 .append(getResumptionTokenID())
125 .toHashCode();
126 }
127
128 }