package com.servinglynk.hmis.warehouse.model.v2016;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.Map;
import java.util.WeakHashMap;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.hibernate.annotations.Type;
import org.hibernate.proxy.HibernateProxy;
import com.servinglynk.hmis.warehouse.enums.ContactLocationEnum;
import com.servinglynk.hmis.warehouse.model.EnrollmentSharingModel;
/**
 * Object mapping for hibernate-handled table: contact.
 *
 *
 * @author autogenerated
 */
@Entity(name = "contact_v2016")
@Table(name = "contact", catalog = "hmis", schema = "v2016")
public class Contact extends HmisBaseModel implements Cloneable, Serializable,EnrollmentSharingModel {
	/** Serial Version UID. */
	private static final long serialVersionUID = -4922450713586410718L;
	/** Use a WeakHashMap so entries will be garbage collected once all entities
		referring to a saved hash are garbage collected themselves. */
	private static final Map<Serializable, java.util.UUID> SAVED_HASHES =
		Collections.synchronizedMap(new WeakHashMap<Serializable, java.util.UUID>());
	/** hashCode temporary storage. */
	private volatile java.util.UUID hashCode;
	/** Field mapping. */
	private LocalDateTime contactDate;
	/** Field mapping. */
	private ContactLocationEnum contactLocation;
	/** Field mapping. */
	private Enrollment enrollmentid;
	/** Field mapping. */
	private java.util.UUID id;
	/**
	 * Default constructor, mainly for hibernate use.
	 */
	public Contact() {
		// Default constructor
	}
	/** Constructor taking a given ID.
	 * @param id to set
	 */
	public Contact(java.util.UUID id) {
		this.id = id;
	}
	/** Return the type of this class. Useful for when dealing with proxies.
	* @return Defining class.
	*/
	@Transient
	public Class<?> getClassType() {
		return Contact.class;
	}
	 /**
	 * Return the value associated with the column: contactDate.
	 * @return A LocalDateTime object (this.contactDate)
	 */
	@Type(type="org.jadira.usertype.dateandtime.threeten.PersistentLocalDateTime")
	@Basic( optional = true )
	@Column( name = "contact_date"  )
	public LocalDateTime getContactDate() {
		return this.contactDate;
	}
	 /**
	 * Set the value related to the column: contactDate.
	 * @param contactDate the contactDate value you wish to set
	 */
	public void setContactDate(final LocalDateTime contactDate) {
		this.contactDate = contactDate;
	}
	 /**
	 * Return the value associated with the column: contactLocation.
	 * @return A Integer object (this.contactLocation)
	 */
	@Type(type = "com.servinglynk.hmis.warehouse.enums.ContactLocationEnumType")
	@Basic( optional = true )
	@Column( name = "contact_location"  )
	public ContactLocationEnum getContactLocation() {
		return this.contactLocation;
	}
	 /**
	 * Set the value related to the column: contactLocation.
	 * @param contactLocation the contactLocation value you wish to set
	 */
	public void setContactLocation(final ContactLocationEnum contactLocation) {
		this.contactLocation = contactLocation;
	}
	 /**
	 * Return the value associated with the column: enrollmentid.
	 * @return A Enrollment object (this.enrollmentid)
	 */
	@ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY )
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
	@Basic( optional = true )
	@JoinColumn(name = "enrollmentid", nullable = true )
	public Enrollment getEnrollmentid() {
		return this.enrollmentid;
	}
	 /**
	 * Set the value related to the column: enrollmentid.
	 * @param enrollmentid the enrollmentid value you wish to set
	 */
	public void setEnrollmentid(final Enrollment enrollmentid) {
		this.enrollmentid = enrollmentid;
	}
	 /**
	 * Return the value associated with the column: id.
	 * @return A java.util.UUID object (this.id)
	 */
	@Id
	 @Basic( optional = false )
    @Column( name = "id", nullable = false  ) @org.hibernate.annotations.Type(type="org.hibernate.type.PostgresUUIDType")
	public java.util.UUID getId() {
		return this.id;
	}
	 /**
	 * Set the value related to the column: id.
	 * @param id the id value you wish to set
	 */
	public void setId(final java.util.UUID id) {
		// If we've just been persisted and hashCode has been
		// returned then make sure other entities with this
		// ID return the already returned hash code
		if ( (this.id == null ) &&
				(id != null) &&
				(this.hashCode != null) ) {
		SAVED_HASHES.put( id, this.hashCode );
		}
		this.id = id;
	}
	/** Field mapping. */
	protected Export export;
	 /**
	 * Return the value associated with the column: export.
	 * @return A Export object (this.export)
	 */
	@ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY )
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
	@Basic( optional = true )
	@JoinColumn(name = "export_id", nullable = true )
	public Export getExport() {
		return this.export;
	}
	 /**
	 * Set the value related to the column: export.
	 * @param export the export value you wish to set
	 */
	public void setExport(final Export export) {
		this.export = export;
	}
   /**
    * Deep copy.
	* @return cloned object
	* @throws CloneNotSupportedException on error
    */
    @Override
    public Contact clone() throws CloneNotSupportedException {
        final Contact copy = (Contact)super.clone();
		copy.setContactDate(this.getContactDate());
		copy.setContactLocation(this.getContactLocation());
		copy.setDateCreated(this.getDateCreated());
		copy.setDateCreatedFromSource(this.getDateCreatedFromSource());
		copy.setDateUpdated(this.getDateUpdated());
		copy.setDateUpdatedFromSource(this.getDateUpdatedFromSource());
		copy.setDeleted(this.isDeleted());
		copy.setEnrollmentid(this.getEnrollmentid());
		copy.setExport(this.getExport());
		copy.setId(this.getId());
		copy.setParentId(this.getParentId());
		copy.setProjectGroupCode(this.getProjectGroupCode());
		copy.setSync(this.isSync());
		copy.setUserId(this.getUserId());
		copy.setVersion(this.getVersion());
		return copy;
	}
	/** Provides toString implementation.
	 * @see java.lang.Object#toString()
	 * @return String representation of this class.
	 */
	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("contactDate: " + this.getContactDate() + ", ");
		sb.append("contactLocation: " + this.getContactLocation() + ", ");
		sb.append("dateCreated: " + this.getDateCreated() + ", ");
		sb.append("dateCreatedFromSource: " + this.getDateCreatedFromSource() + ", ");
		sb.append("dateUpdated: " + this.getDateUpdated() + ", ");
		sb.append("dateUpdatedFromSource: " + this.getDateUpdatedFromSource() + ", ");
		sb.append("deleted: " + this.isDeleted() + ", ");
		sb.append("id: " + this.getId() + ", ");
		sb.append("parentId: " + this.getParentId() + ", ");
		sb.append("projectGroupCode: " + this.getProjectGroupCode() + ", ");
		sb.append("sync: " + this.isSync() + ", ");
		sb.append("userId: " + this.getUserId() + ", ");
		sb.append("version: " + this.getVersion());
		return sb.toString();
	}
	/** Equals implementation.
	 * @see java.lang.Object#equals(java.lang.Object)
	 * @param aThat Object to compare with
	 * @return true/false
	 */
	@Override
	public boolean equals(final Object aThat) {
		Object proxyThat = aThat;
		if ( this == aThat ) {
			 return true;
		}


Answer: 		if (aThat instanceof HibernateProxy) {