/******************************************************************************* * Copyright (c) 1998, 2015 Oracle and/or its affiliates. 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: * Oracle - initial API and implementation from Oracle TopLink ******************************************************************************/ package org.eclipse.persistence.testing.models.jpa.partitioned; import java.io.Serializable; import javax.persistence.*; import org.eclipse.persistence.annotations.Partitioned; import org.eclipse.persistence.annotations.Partitioning; /** * <p><b>Purpose</b>: Represents the mailing address on an Employee * <p><b>Description</b>: Held in a private 1:1 relationship from Employee * @see Employee */ @Entity @Table(name="PART_ADDRESS") @Partitioning(name="custom", partitioningClass=EmployeePartitioningPolicy.class) @Partitioned("custom") public class Address implements Serializable { @Id @GeneratedValue(strategy=GenerationType.TABLE) @Column(name="ADDRESS_ID") private int id; @Version private Integer version; private String street; private String city; private String province; @Column(name="P_CODE") private String postalCode; private String country; public Address() { city = ""; province = ""; postalCode = ""; street = ""; country = ""; } public Address(String street, String city, String province, String country, String postalCode) { this.street = street; this.city = city; this.province = province; this.country = country; this.postalCode = postalCode; } public int getID() { return id; } public void setID(int id) { this.id = id; } public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getProvince() { return province; } public void setProvince(String province) { this.province = province; } public String getPostalCode() { return postalCode; } public void setPostalCode(String postalCode) { this.postalCode = postalCode; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public Integer getVersion() { return version; } public void setVersion(Integer version) { this.version = version; } }