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

nz.co.senanque.workflow.orderinstances.Order Maven / Gradle / Ivy

Go to download

Example of a simple workflow in a bundle. This workflow doesn't actually do anything.

The 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: 2018.04.23 at 11:20:08 PM UTC 
//


package nz.co.senanque.workflow.orderinstances;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
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.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import nz.co.senanque.validationengine.ListeningArray;
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 nz.co.senanque.validationengine.annotations.Label;
import nz.co.senanque.validationengine.annotations.Length;
import nz.co.senanque.validationengine.annotations.Range;
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;


/**
 * 

Java class for Order complex type. * *

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

 * <complexType name="Order">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}long"/>
 *         <element name="version" type="{http://www.w3.org/2001/XMLSchema}long"/>
 *         <element name="orderName">
 *           <simpleType>
 *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *               <maxLength value="50"/>
 *             </restriction>
 *           </simpleType>
 *         </element>
 *         <element name="fahrenheit">
 *           <simpleType>
 *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *               <maxLength value="10"/>
 *             </restriction>
 *           </simpleType>
 *         </element>
 *         <element name="retryFlag" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 *         <element name="rejected" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 *         <element name="decisionField" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 *         <element name="celsius" type="{http://www.w3.org/2001/XMLSchema}float"/>
 *         <element name="orderItems" type="{http://www.senanque.co.nz/pizzaorder}OrderItem" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Order", propOrder = { "id", "version", "orderName", "fahrenheit", "retryFlag", "rejected", "decisionField", "celsius", "orderItems" }) @XmlRootElement(name = "Order") @Entity(name = "Order") @Table(name = "ORDER_") @Inheritance(strategy = InheritanceType.JOINED) public class Order implements ValidationObject, Equals, HashCode, ToString { protected long id; protected long version; @XmlElement(required = true) protected String orderName; @XmlElement(required = true) protected String fahrenheit; protected boolean retryFlag; protected boolean rejected; protected boolean decisionField; protected float celsius; protected List orderItems; @XmlTransient protected ValidationSession m_validationSession; @XmlTransient protected ObjectMetadata m_metadata; @XmlTransient public final static String ID = "id"; @XmlTransient public final static String VERSION = "version"; @XmlTransient public final static String ORDERNAME = "orderName"; @XmlTransient public final static String FAHRENHEIT = "fahrenheit"; @XmlTransient public final static String RETRYFLAG = "retryFlag"; @XmlTransient public final static String REJECTED = "rejected"; @XmlTransient public final static String DECISIONFIELD = "decisionField"; @XmlTransient public final static String CELSIUS = "celsius"; @XmlTransient public final static String ORDERITEMS = "orderItems"; public Order() { ValidationUtils.setDefaults(this); } /** * Gets the value of the id property. * */ @Id @Column(name = "ID", scale = 0) @GeneratedValue(strategy = GenerationType.AUTO) @Range(maxInclusive = "9223372036854775807", minInclusive = "-9223372036854775808") 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 version property. * */ @Version @Column(name = "VERSION_", scale = 0) @Range(maxInclusive = "9223372036854775807", minInclusive = "-9223372036854775808") public long getVersion() { if (m_validationSession!= null) { m_validationSession.clean(this); } return version; } /** * Sets the value of the version property. * */ public void setVersion(long value) { getMetadata().removeUnknown("version"); if (m_validationSession!= null) { m_validationSession.set(this, "version", value, version); } this.version = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "version", value, version); } } /** * Gets the value of the orderName property. * * @return * possible object is * {@link String } * */ @Label(labelName = "Order Name") @Basic @Column(name = "ORDERNAME", length = 50) @Length(minLength = "0", maxLength = "50") public String getOrderName() { if (m_validationSession!= null) { m_validationSession.clean(this); } return orderName; } /** * Sets the value of the orderName property. * * @param value * allowed object is * {@link String } * */ public void setOrderName(String value) { getMetadata().removeUnknown("orderName"); if (m_validationSession!= null) { m_validationSession.set(this, "orderName", value, orderName); } this.orderName = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "orderName", value, orderName); } } /** * Gets the value of the fahrenheit property. * * @return * possible object is * {@link String } * */ @Label(labelName = "Fahrenheit") @Basic @Column(name = "FAHRENHEIT", length = 10) @Length(minLength = "0", maxLength = "10") public String getFahrenheit() { if (m_validationSession!= null) { m_validationSession.clean(this); } return fahrenheit; } /** * Sets the value of the fahrenheit property. * * @param value * allowed object is * {@link String } * */ public void setFahrenheit(String value) { getMetadata().removeUnknown("fahrenheit"); if (m_validationSession!= null) { m_validationSession.set(this, "fahrenheit", value, fahrenheit); } this.fahrenheit = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "fahrenheit", value, fahrenheit); } } /** * Gets the value of the retryFlag property. * */ @Label(labelName = "Retry Flag") @Basic @Column(name = "RETRYFLAG") public boolean isRetryFlag() { if (m_validationSession!= null) { m_validationSession.clean(this); } return retryFlag; } /** * Sets the value of the retryFlag property. * */ public void setRetryFlag(boolean value) { getMetadata().removeUnknown("retryFlag"); if (m_validationSession!= null) { m_validationSession.set(this, "retryFlag", value, retryFlag); } this.retryFlag = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "retryFlag", value, retryFlag); } } /** * Gets the value of the rejected property. * */ @Label(labelName = "rejected") @Basic @Column(name = "REJECTED") public boolean isRejected() { if (m_validationSession!= null) { m_validationSession.clean(this); } return rejected; } /** * Sets the value of the rejected property. * */ public void setRejected(boolean value) { getMetadata().removeUnknown("rejected"); if (m_validationSession!= null) { m_validationSession.set(this, "rejected", value, rejected); } this.rejected = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "rejected", value, rejected); } } /** * Gets the value of the decisionField property. * */ @Label(labelName = "Decision Field") @Basic @Column(name = "DECISIONFIELD") public boolean isDecisionField() { if (m_validationSession!= null) { m_validationSession.clean(this); } return decisionField; } /** * Sets the value of the decisionField property. * */ public void setDecisionField(boolean value) { getMetadata().removeUnknown("decisionField"); if (m_validationSession!= null) { m_validationSession.set(this, "decisionField", value, decisionField); } this.decisionField = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "decisionField", value, decisionField); } } /** * Gets the value of the celsius property. * */ @Label(labelName = "Celsius") @Basic @Column(name = "CELSIUS", precision = 20, scale = 10) public float getCelsius() { if (m_validationSession!= null) { m_validationSession.clean(this); } return celsius; } /** * Sets the value of the celsius property. * */ public void setCelsius(float value) { getMetadata().removeUnknown("celsius"); if (m_validationSession!= null) { m_validationSession.set(this, "celsius", value, celsius); } this.celsius = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "celsius", value, celsius); } } /** * Gets the value of the orderItems property. * *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a set method for the orderItems property. * *

* For example, to add a new item, do as follows: *

     *    getOrderItems().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link OrderItem } * * */ @OneToMany(targetEntity = OrderItem.class, cascade = { CascadeType.ALL }) @JoinColumn(name = "ORDERITEMS_ORDER__ID") public List getOrderItems() { if (m_validationSession!= null) { m_validationSession.clean(this); } if (orderItems == null) { orderItems = new ListeningArray(); } if (orderItems == null) { orderItems = new ArrayList(); } return this.orderItems; } /** * * */ public void setOrderItems(List orderItems) { getMetadata().removeUnknown("orderItems"); if (m_validationSession!= null) { m_validationSession.set(this, "orderItems", orderItems, orderItems); } this.orderItems = orderItems; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "orderItems", orderItems, orderItems); } } public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof Order)) { return false; } if (this == object) { return true; } final Order that = ((Order) 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; } } { long lhsVersion; lhsVersion = (true?this.getVersion(): 0L); long rhsVersion; rhsVersion = (true?that.getVersion(): 0L); if (!strategy.equals(LocatorUtils.property(thisLocator, "version", lhsVersion), LocatorUtils.property(thatLocator, "version", rhsVersion), lhsVersion, rhsVersion)) { return false; } } { String lhsOrderName; lhsOrderName = this.getOrderName(); String rhsOrderName; rhsOrderName = that.getOrderName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "orderName", lhsOrderName), LocatorUtils.property(thatLocator, "orderName", rhsOrderName), lhsOrderName, rhsOrderName)) { return false; } } { String lhsFahrenheit; lhsFahrenheit = this.getFahrenheit(); String rhsFahrenheit; rhsFahrenheit = that.getFahrenheit(); if (!strategy.equals(LocatorUtils.property(thisLocator, "fahrenheit", lhsFahrenheit), LocatorUtils.property(thatLocator, "fahrenheit", rhsFahrenheit), lhsFahrenheit, rhsFahrenheit)) { return false; } } { boolean lhsRetryFlag; lhsRetryFlag = (true?this.isRetryFlag():false); boolean rhsRetryFlag; rhsRetryFlag = (true?that.isRetryFlag():false); if (!strategy.equals(LocatorUtils.property(thisLocator, "retryFlag", lhsRetryFlag), LocatorUtils.property(thatLocator, "retryFlag", rhsRetryFlag), lhsRetryFlag, rhsRetryFlag)) { return false; } } { boolean lhsRejected; lhsRejected = (true?this.isRejected():false); boolean rhsRejected; rhsRejected = (true?that.isRejected():false); if (!strategy.equals(LocatorUtils.property(thisLocator, "rejected", lhsRejected), LocatorUtils.property(thatLocator, "rejected", rhsRejected), lhsRejected, rhsRejected)) { return false; } } { boolean lhsDecisionField; lhsDecisionField = (true?this.isDecisionField():false); boolean rhsDecisionField; rhsDecisionField = (true?that.isDecisionField():false); if (!strategy.equals(LocatorUtils.property(thisLocator, "decisionField", lhsDecisionField), LocatorUtils.property(thatLocator, "decisionField", rhsDecisionField), lhsDecisionField, rhsDecisionField)) { return false; } } { float lhsCelsius; lhsCelsius = (true?this.getCelsius(): 0.0F); float rhsCelsius; rhsCelsius = (true?that.getCelsius(): 0.0F); if (!strategy.equals(LocatorUtils.property(thisLocator, "celsius", lhsCelsius), LocatorUtils.property(thatLocator, "celsius", rhsCelsius), lhsCelsius, rhsCelsius)) { return false; } } { List lhsOrderItems; lhsOrderItems = (((this.orderItems!= null)&&(!this.orderItems.isEmpty()))?this.getOrderItems():null); List rhsOrderItems; rhsOrderItems = (((that.orderItems!= null)&&(!that.orderItems.isEmpty()))?that.getOrderItems():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "orderItems", lhsOrderItems), LocatorUtils.property(thatLocator, "orderItems", rhsOrderItems), lhsOrderItems, rhsOrderItems)) { 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); } { long theVersion; theVersion = (true?this.getVersion(): 0L); strategy.appendField(locator, this, "version", buffer, theVersion); } { String theOrderName; theOrderName = this.getOrderName(); strategy.appendField(locator, this, "orderName", buffer, theOrderName); } { String theFahrenheit; theFahrenheit = this.getFahrenheit(); strategy.appendField(locator, this, "fahrenheit", buffer, theFahrenheit); } { boolean theRetryFlag; theRetryFlag = (true?this.isRetryFlag():false); strategy.appendField(locator, this, "retryFlag", buffer, theRetryFlag); } { boolean theRejected; theRejected = (true?this.isRejected():false); strategy.appendField(locator, this, "rejected", buffer, theRejected); } { boolean theDecisionField; theDecisionField = (true?this.isDecisionField():false); strategy.appendField(locator, this, "decisionField", buffer, theDecisionField); } { float theCelsius; theCelsius = (true?this.getCelsius(): 0.0F); strategy.appendField(locator, this, "celsius", buffer, theCelsius); } { List theOrderItems; theOrderItems = (((this.orderItems!= null)&&(!this.orderItems.isEmpty()))?this.getOrderItems():null); strategy.appendField(locator, this, "orderItems", buffer, theOrderItems); } 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); } { long theVersion; theVersion = (true?this.getVersion(): 0L); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "version", theVersion), currentHashCode, theVersion); } { String theOrderName; theOrderName = this.getOrderName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "orderName", theOrderName), currentHashCode, theOrderName); } { String theFahrenheit; theFahrenheit = this.getFahrenheit(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "fahrenheit", theFahrenheit), currentHashCode, theFahrenheit); } { boolean theRetryFlag; theRetryFlag = (true?this.isRetryFlag():false); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "retryFlag", theRetryFlag), currentHashCode, theRetryFlag); } { boolean theRejected; theRejected = (true?this.isRejected():false); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "rejected", theRejected), currentHashCode, theRejected); } { boolean theDecisionField; theDecisionField = (true?this.isDecisionField():false); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "decisionField", theDecisionField), currentHashCode, theDecisionField); } { float theCelsius; theCelsius = (true?this.getCelsius(): 0.0F); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "celsius", theCelsius), currentHashCode, theCelsius); } { List theOrderItems; theOrderItems = (((this.orderItems!= null)&&(!this.orderItems.isEmpty()))?this.getOrderItems():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "orderItems", theOrderItems), currentHashCode, theOrderItems); } 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