/******************************************************************************* * 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 test.org.eclipse.persistence.testing.models.jpa.spring; import javax.persistence.*; @Entity @Table(name="Spring_TLE_Address") public class Address { private Integer id; private int number; private String street; private Route route; public Address() {} public Address (Integer id, int number, String street){ this.id = id; this.number = number; this.street = street; } @Id @GeneratedValue(strategy = GenerationType.AUTO) public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @Column(name = "NUM") public int getNumber() { return number; } public void setNumber(int number) { this.number = number; } public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) public Route getRoute() { return route; } public void setRoute(Route route) { this.route = route; } }