All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nz.co.senanque.workflow.instances.Attachment Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 
// See http://java.sun.com/xml/jaxb 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2016.04.01 at 11:03:38 AM NZDT 
//


package nz.co.senanque.workflow.instances;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import nz.co.senanque.validationengine.ObjectMetadata;
import nz.co.senanque.validationengine.ValidationObject;
import nz.co.senanque.validationengine.ValidationSession;
import nz.co.senanque.validationengine.ValidationUtils;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
import org.jvnet.jaxb2_commons.lang.HashCode;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
import org.w3._2001.xmlschema.Adapter1;


/**
 * 

Java class for Attachment complex type. * *

The following schema fragment specifies the expected content contained within this class. * *

 * <complexType name="Attachment">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/>
 *         <element name="body" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
 *         <element name="created" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
 *         <element name="fileName">
 *           <simpleType>
 *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *               <maxLength value="200"/>
 *             </restriction>
 *           </simpleType>
 *         </element>
 *         <element name="MIMEType">
 *           <simpleType>
 *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *               <maxLength value="20"/>
 *             </restriction>
 *           </simpleType>
 *         </element>
 *         <element name="processInstanceId" type="{http://www.w3.org/2001/XMLSchema}long"/>
 *         <element name="protectedDocument" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 *         <element name="comment">
 *           <simpleType>
 *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *               <maxLength value="200"/>
 *             </restriction>
 *           </simpleType>
 *         </element>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Attachment", propOrder = { "id", "body", "created", "fileName", "mimeType", "processInstanceId", "protectedDocument", "comment" }) @Entity(name = "Attachment") @Table(name = "ATTACHMENT") @Inheritance(strategy = InheritanceType.JOINED) public class Attachment implements Serializable, ValidationObject, Equals, HashCode, ToString { protected long id; @XmlElement(required = true) protected byte[] body; @XmlElement(required = true, type = String.class) @XmlJavaTypeAdapter(Adapter1 .class) @XmlSchemaType(name = "dateTime") protected Date created; @XmlElement(required = true) protected String fileName; @XmlElement(name = "MIMEType", required = true) protected String mimeType; protected long processInstanceId; protected boolean protectedDocument; @XmlElement(required = true) protected String comment; @XmlTransient protected ValidationSession m_validationSession; @XmlTransient protected ObjectMetadata m_metadata; @XmlTransient public final static String ID = "id"; @XmlTransient public final static String BODY = "body"; @XmlTransient public final static String CREATED = "created"; @XmlTransient public final static String FILENAME = "fileName"; @XmlTransient public final static String MIMETYPE = "mIMEType"; @XmlTransient public final static String PROCESSINSTANCEID = "processInstanceId"; @XmlTransient public final static String PROTECTEDDOCUMENT = "protectedDocument"; @XmlTransient public final static String COMMENT = "comment"; public Attachment() { ValidationUtils.setDefaults(this); } /** * Gets the value of the id property. * */ @Id @Column(name = "ID", scale = 0) @GeneratedValue(strategy = GenerationType.AUTO) public long getId() { if (m_validationSession!= null) { m_validationSession.clean(this); } return id; } /** * Sets the value of the id property. * */ public void setId(long value) { getMetadata().removeUnknown("id"); if (m_validationSession!= null) { m_validationSession.set(this, "id", value, id); } this.id = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "id", value, id); } } /** * Gets the value of the body property. * * @return * possible object is * byte[] */ @Basic @Column(name = "BODY") @Lob public byte[] getBody() { if (m_validationSession!= null) { m_validationSession.clean(this); } return body; } /** * Sets the value of the body property. * * @param value * allowed object is * byte[] */ public void setBody(byte[] value) { getMetadata().removeUnknown("body"); if (m_validationSession!= null) { m_validationSession.set(this, "body", value, body); } this.body = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "body", value, body); } } /** * Gets the value of the created property. * * @return * possible object is * {@link String } * */ @Basic @Column(name = "CREATED") @Temporal(TemporalType.TIMESTAMP) public Date getCreated() { if (m_validationSession!= null) { m_validationSession.clean(this); } return created; } /** * Sets the value of the created property. * * @param value * allowed object is * {@link String } * */ public void setCreated(Date value) { getMetadata().removeUnknown("created"); if (m_validationSession!= null) { m_validationSession.set(this, "created", value, created); } this.created = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "created", value, created); } } /** * Gets the value of the fileName property. * * @return * possible object is * {@link String } * */ @Basic @Column(name = "FILENAME", length = 200) public String getFileName() { if (m_validationSession!= null) { m_validationSession.clean(this); } return fileName; } /** * Sets the value of the fileName property. * * @param value * allowed object is * {@link String } * */ public void setFileName(String value) { getMetadata().removeUnknown("fileName"); if (m_validationSession!= null) { m_validationSession.set(this, "fileName", value, fileName); } this.fileName = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "fileName", value, fileName); } } /** * Gets the value of the mimeType property. * * @return * possible object is * {@link String } * */ @Basic @Column(name = "MIMETYPE", length = 20) public String getMIMEType() { if (m_validationSession!= null) { m_validationSession.clean(this); } return mimeType; } /** * Sets the value of the mimeType property. * * @param value * allowed object is * {@link String } * */ public void setMIMEType(String value) { this.mimeType = value; } /** * Gets the value of the processInstanceId property. * */ @Basic @Column(name = "PROCESSINSTANCEID", precision = 20, scale = 0) public long getProcessInstanceId() { if (m_validationSession!= null) { m_validationSession.clean(this); } return processInstanceId; } /** * Sets the value of the processInstanceId property. * */ public void setProcessInstanceId(long value) { getMetadata().removeUnknown("processInstanceId"); if (m_validationSession!= null) { m_validationSession.set(this, "processInstanceId", value, processInstanceId); } this.processInstanceId = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "processInstanceId", value, processInstanceId); } } /** * Gets the value of the protectedDocument property. * */ @Basic @Column(name = "PROTECTEDDOCUMENT") public boolean isProtectedDocument() { if (m_validationSession!= null) { m_validationSession.clean(this); } return protectedDocument; } /** * Sets the value of the protectedDocument property. * */ public void setProtectedDocument(boolean value) { getMetadata().removeUnknown("protectedDocument"); if (m_validationSession!= null) { m_validationSession.set(this, "protectedDocument", value, protectedDocument); } this.protectedDocument = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "protectedDocument", value, protectedDocument); } } /** * Gets the value of the comment property. * * @return * possible object is * {@link String } * */ @Basic @Column(name = "COMMENT_", length = 200) public String getComment() { if (m_validationSession!= null) { m_validationSession.clean(this); } return comment; } /** * Sets the value of the comment property. * * @param value * allowed object is * {@link String } * */ public void setComment(String value) { getMetadata().removeUnknown("comment"); if (m_validationSession!= null) { m_validationSession.set(this, "comment", value, comment); } this.comment = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "comment", value, comment); } } public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof Attachment)) { return false; } if (this == object) { return true; } final Attachment that = ((Attachment) object); { long lhsId; lhsId = (true?this.getId(): 0L); long rhsId; rhsId = (true?that.getId(): 0L); if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId)) { return false; } } { byte[] lhsBody; lhsBody = this.getBody(); byte[] rhsBody; rhsBody = that.getBody(); if (!strategy.equals(LocatorUtils.property(thisLocator, "body", lhsBody), LocatorUtils.property(thatLocator, "body", rhsBody), lhsBody, rhsBody)) { return false; } } { Date lhsCreated; lhsCreated = this.getCreated(); Date rhsCreated; rhsCreated = that.getCreated(); if (!strategy.equals(LocatorUtils.property(thisLocator, "created", lhsCreated), LocatorUtils.property(thatLocator, "created", rhsCreated), lhsCreated, rhsCreated)) { return false; } } { String lhsFileName; lhsFileName = this.getFileName(); String rhsFileName; rhsFileName = that.getFileName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "fileName", lhsFileName), LocatorUtils.property(thatLocator, "fileName", rhsFileName), lhsFileName, rhsFileName)) { return false; } } { String lhsMIMEType; lhsMIMEType = this.getMIMEType(); String rhsMIMEType; rhsMIMEType = that.getMIMEType(); if (!strategy.equals(LocatorUtils.property(thisLocator, "mimeType", lhsMIMEType), LocatorUtils.property(thatLocator, "mimeType", rhsMIMEType), lhsMIMEType, rhsMIMEType)) { return false; } } { long lhsProcessInstanceId; lhsProcessInstanceId = (true?this.getProcessInstanceId(): 0L); long rhsProcessInstanceId; rhsProcessInstanceId = (true?that.getProcessInstanceId(): 0L); if (!strategy.equals(LocatorUtils.property(thisLocator, "processInstanceId", lhsProcessInstanceId), LocatorUtils.property(thatLocator, "processInstanceId", rhsProcessInstanceId), lhsProcessInstanceId, rhsProcessInstanceId)) { return false; } } { boolean lhsProtectedDocument; lhsProtectedDocument = (true?this.isProtectedDocument():false); boolean rhsProtectedDocument; rhsProtectedDocument = (true?that.isProtectedDocument():false); if (!strategy.equals(LocatorUtils.property(thisLocator, "protectedDocument", lhsProtectedDocument), LocatorUtils.property(thatLocator, "protectedDocument", rhsProtectedDocument), lhsProtectedDocument, rhsProtectedDocument)) { return false; } } { String lhsComment; lhsComment = this.getComment(); String rhsComment; rhsComment = that.getComment(); if (!strategy.equals(LocatorUtils.property(thisLocator, "comment", lhsComment), LocatorUtils.property(thatLocator, "comment", rhsComment), lhsComment, rhsComment)) { return false; } } return true; } public boolean equals(Object object) { final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); } public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); } public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; } public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { long theId; theId = (true?this.getId(): 0L); strategy.appendField(locator, this, "id", buffer, theId); } { byte[] theBody; theBody = this.getBody(); strategy.appendField(locator, this, "body", buffer, theBody); } { Date theCreated; theCreated = this.getCreated(); strategy.appendField(locator, this, "created", buffer, theCreated); } { String theFileName; theFileName = this.getFileName(); strategy.appendField(locator, this, "fileName", buffer, theFileName); } { String theMIMEType; theMIMEType = this.getMIMEType(); strategy.appendField(locator, this, "mimeType", buffer, theMIMEType); } { long theProcessInstanceId; theProcessInstanceId = (true?this.getProcessInstanceId(): 0L); strategy.appendField(locator, this, "processInstanceId", buffer, theProcessInstanceId); } { boolean theProtectedDocument; theProtectedDocument = (true?this.isProtectedDocument():false); strategy.appendField(locator, this, "protectedDocument", buffer, theProtectedDocument); } { String theComment; theComment = this.getComment(); strategy.appendField(locator, this, "comment", buffer, theComment); } return buffer; } public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { long theId; theId = (true?this.getId(): 0L); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId); } { byte[] theBody; theBody = this.getBody(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "body", theBody), currentHashCode, theBody); } { Date theCreated; theCreated = this.getCreated(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "created", theCreated), currentHashCode, theCreated); } { String theFileName; theFileName = this.getFileName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "fileName", theFileName), currentHashCode, theFileName); } { String theMIMEType; theMIMEType = this.getMIMEType(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mimeType", theMIMEType), currentHashCode, theMIMEType); } { long theProcessInstanceId; theProcessInstanceId = (true?this.getProcessInstanceId(): 0L); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "processInstanceId", theProcessInstanceId), currentHashCode, theProcessInstanceId); } { boolean theProtectedDocument; theProtectedDocument = (true?this.isProtectedDocument():false); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "protectedDocument", theProtectedDocument), currentHashCode, theProtectedDocument); } { String theComment; theComment = this.getComment(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "comment", theComment), currentHashCode, theComment); } return currentHashCode; } public int hashCode() { final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); } @Transient public ObjectMetadata getMetadata() { if (m_validationSession!= null) { m_validationSession.clean(this); } if (m_metadata == null) { m_metadata = new ObjectMetadata(); } return m_metadata; } @XmlTransient public void setValidationSession(ValidationSession validationSession) { m_validationSession = validationSession; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy