package data;

import java.util.*;
import data.*;


/** fileName=/projects/quickstart/gen/data/PurchaseOrder.java xmi.id=
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public  class PurchaseOrder implements java.io.Serializable {
	/**
	 * <!-- begin-user-doc -->
	 * no argument constructor
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PurchaseOrder() {
		
		// begin-user-code
		// end-user-code
	}
	
	/**
	 * <!-- begin-user-doc -->
	 * constructor on id
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PurchaseOrder(Integer id) {
		setId(id);
		// begin-user-code
		// end-user-code
	}
	
	/**
	 * <!-- begin-user-doc -->
	 * copy constructor
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PurchaseOrder(PurchaseOrder o) {
		setId(o.getId());
		setNumber(o.getNumber());
		setReceived(o.getReceived());
		setPrice(o.getPrice());
		setCustomer(o.getCustomer());
		// begin-user-code
		// end-user-code
	}

	/**
	 * <!-- begin-user-doc -->
	 * constructor on attributes and navigable associations
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PurchaseOrder(Integer id, String number, Date received, Double price, Customer customer) {		
		setId(id);
		setNumber(number);
		setReceived(received);
		setPrice(price);
		
		setCustomer(customer);
		// begin-user-code
		// end-user-code
	}
		
	/**
	 * <!-- begin-user-doc -->
	 * set attributes and imported associations
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setData(PurchaseOrder o) {
		
		setNumber(o.getNumber());
		setReceived(o.getReceived());
		setPrice(o.getPrice());
		setCustomer(o.getCustomer());
		// begin-user-code
		// end-user-code
	}
	
	
	
	/** primary key
	 * @unmodifiable
	 */
	protected Integer id;
	/**
	 * @unmodifiable
	 */
	public Integer getId() {
		return id;
	}
	/**
	 * @unmodifiable
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	
	/** xmi.id=
	 * @unmodifiable
	 */
	protected String number;
	/** 
	 * @unmodifiable
	 */
	public String getNumber() {
		return number;
	}
	/** 
	 * @unmodifiable
	 */
	public void setNumber(String number) {
		this.number = number;
	}
	
	/** xmi.id=
	 * @unmodifiable
	 */
	protected Date received;
	/** 
	 * @unmodifiable
	 */
	public Date getReceived() {
		return received;
	}
	/** 
	 * @unmodifiable
	 */
	public void setReceived(Date received) {
		this.received = received;
	}
	
	/** xmi.id=
	 * @unmodifiable
	 */
	protected Double price;
	/** 
	 * @unmodifiable
	 */
	public Double getPrice() {
		return price;
	}
	/** 
	 * @unmodifiable
	 */
	public void setPrice(Double price) {
		this.price = price;
	}
	
	/** xmi.id=
	 * myUpper=1 otherUpper=-1
	 * @unmodifiable
	 */
	protected Customer customer;
	/** 
	 * @unmodifiable
	 */
	public Customer getCustomer() {
		return customer;
	}
	/** 
	 * @unmodifiable
	 */
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
			
	
	/** 
	 * <!-- begin-user-doc -->
	 * comma separated values of all fields
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String toString() {
		StringBuffer sb = new StringBuffer(super.toString());
		sb.append("[");
		
		sb.append(id);
		sb.append(", ");
		sb.append(number);
		sb.append(", ");
		sb.append(received);
		sb.append(", ");
		sb.append(price);
		
		sb.append("]");
		// begin-user-code
		// end-user-code
		return sb.toString();
	}

	/** 
	 * <!-- begin-user-doc -->
	 * space separated values of selected fields for display
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String toDisplayString() {
		StringBuffer sb = new StringBuffer();
		// begin-user-code
		
		sb.append(number == null ? "" : number.toString());
		
		// end-user-code
		return sb.toString();
	}
	
	/** 
	 * @unmodifiable
	 */
	public boolean equals(Object other) {
		if (this == other) return true;

		if (!(other instanceof PurchaseOrder)) return false;
		if(!super.equals(other)) return false;
		final PurchaseOrder o = (PurchaseOrder) other;

		
		if(o.getNumber() == null) {
			if (getNumber() != null) return false;
		}
		else if (!o.getNumber().equals(getNumber()))
			return false;
		
		if(o.getReceived() == null) {
			if (getReceived() != null) return false;
		}
		else if (!o.getReceived().equals(getReceived()))
			return false;
		
		if(o.getPrice() == null) {
			if (getPrice() != null) return false;
		}
		else if (!o.getPrice().equals(getPrice()))
			return false;
		

		return true;
	}

	/** 
	 * @unmodifiable
	 */
	public int hashCode() {
		int res = 0;
		
		if(getNumber() != null)
			res = 29 * res + getNumber().hashCode();
		
		if(getReceived() != null)
			res = 29 * res + getReceived().hashCode();
		
		if(getPrice() != null)
			res = 29 * res + getPrice().hashCode();
		
		return res;
	}
}
	
Syntax Highlighting created using the com.Ostermiller.Syntax package.
Tuesday, September 18 2007 at 17:58