01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.openjpa.persistence.common.apps;
20:
21: import javax.persistence.*;
22:
23: @Entity
24: public class Address {
25: @Basic
26: @Column(length=50)
27: private String streetAd;
28:
29: @Basic
30: @Column(length=50)
31: private String city;
32:
33: @Basic
34: @Column(length=50)
35: private String country;
36:
37: @Basic
38: @Column(length=25)
39: private String zipcode;
40:
41: @OneToOne(mappedBy="address")
42: private CompUser user;
43:
44: @Id
45: @GeneratedValue(strategy=GenerationType.AUTO)
46: private int id;
47:
48: public Address() {
49: }
50:
51: public Address(String streetAd, String city, String country,
52: String zipcode) {
53: this .streetAd = streetAd;
54: this .city = city;
55: this .country = country;
56: this .zipcode = zipcode;
57: }
58:
59: public String getCity() {
60: return city;
61: }
62:
63: public void setCity(String city) {
64: this .city = city;
65: }
66:
67: public String getCountry() {
68: return country;
69: }
70:
71: public void setCountry(String country) {
72: this .country = country;
73: }
74:
75: public int getId() {
76: return id;
77: }
78:
79: public String getStreetAd() {
80: return streetAd;
81: }
82:
83: public void setStreetAd(String streetAd) {
84: this .streetAd = streetAd;
85: }
86:
87: public String getZipcode() {
88: return zipcode;
89: }
90:
91: public void setZipcode(String zipcode) {
92: this.zipcode = zipcode;
93: }
94: }
|