/******************************************************************************* * Copyright (c) 2016 IBM Corporation. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * 08/24/2016 - Will Dazey * - 500145 : Nested Embeddables Test ******************************************************************************/ package org.eclipse.persistence.jpa.embeddable.model; import javax.persistence.Embeddable; @Embeddable public class Zipcode { protected String zip; public Zipcode() {} public Zipcode(String zip) { this.setZip(zip); } public String getZip() { return zip; } public void setZip(String zip) { this.zip = zip; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((zip == null) ? 0 : zip.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Zipcode other = (Zipcode) obj; if (zip == null) { if (other.zip != null) return false; } else if (!zip.equals(other.zip)) return false; return true; } }