This project has retired. For details please refer to its Attic page.
Address xref
View Javadoc
1   package org.apache.juddi.model;
2   /*
3    * Copyright 2001-2008 The Apache Software Foundation.
4    * 
5    * Licensed under the Apache License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  import java.util.ArrayList;
18  import java.util.List;
19  
20  import javax.persistence.CascadeType;
21  import javax.persistence.Column;
22  import javax.persistence.Entity;
23  import javax.persistence.FetchType;
24  import javax.persistence.GeneratedValue;
25  import javax.persistence.GenerationType;
26  import javax.persistence.Id;
27  import javax.persistence.JoinColumn;
28  import javax.persistence.ManyToOne;
29  import javax.persistence.OneToMany;
30  import javax.persistence.OrderBy;
31  import javax.persistence.Table;
32  
33  /**
34   * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
35   * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
36   */
37  @Entity
38  @Table(name = "j3_address")
39  public class Address implements java.io.Serializable {
40  
41  	private static final long serialVersionUID = 7767275374035531912L;
42  	private Long id;
43  	private Contact contact;
44  	private String useType;
45  	private String sortCode;
46  	private String tmodelKey;
47  	private List<AddressLine> addressLines = new ArrayList<AddressLine>(0);
48  
49  	public Address() {
50  	}
51  
52  	public Address(Contact contact) {
53  		this.contact = contact;
54  	}
55  	public Address(Long id, Contact contact, String useType,
56  			String sortCode, String tmodelKey, List<AddressLine> addressLines) {
57  		this.contact = contact;
58  		this.useType = useType;
59  		this.sortCode = sortCode;
60  		this.tmodelKey = tmodelKey;
61  		this.addressLines = addressLines;
62  	}
63  
64  	@Id
65  	@GeneratedValue(strategy=GenerationType.AUTO)
66  	public Long getId() {
67  		return this.id;
68  	}
69  	public void setId(Long id) {
70  		this.id = id;
71  	}
72  
73  	@ManyToOne(fetch = FetchType.LAZY)
74  	@JoinColumn(name = "address_id", nullable = false)
75  	public Contact getContact() {
76  		return this.contact;
77  	}
78  	public void setContact(Contact contact) {
79  		this.contact = contact;
80  	}
81  
82  	@Column(name = "use_type")
83  	public String getUseType() {
84  		return this.useType;
85  	}
86  	public void setUseType(String useType) {
87  		this.useType = useType;
88  	}
89  
90  	@Column(name = "sort_code", length = 10)
91  	public String getSortCode() {
92  		return this.sortCode;
93  	}
94  	public void setSortCode(String sortCode) {
95  		this.sortCode = sortCode;
96  	}
97  
98  	@Column(name = "tmodel_key", length = 255)
99  	public String getTmodelKey() {
100 		return this.tmodelKey;
101 	}
102 	public void setTmodelKey(String tmodelKey) {
103 		this.tmodelKey = tmodelKey;
104 	}
105 
106 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "address")
107 	@OrderBy
108 	public List<AddressLine> getAddressLines() {
109 		return this.addressLines;
110 	}
111 	public void setAddressLines(List<AddressLine> addressLines) {
112 		this.addressLines = addressLines;
113 	}
114 
115 }