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  
18  import javax.persistence.Column;
19  import javax.persistence.Entity;
20  import javax.persistence.FetchType;
21  import javax.persistence.GeneratedValue;
22  import javax.persistence.GenerationType;
23  import javax.persistence.Id;
24  import javax.persistence.JoinColumn;
25  import javax.persistence.ManyToOne;
26  import javax.persistence.Table;
27  
28  /**
29   * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
30   */
31  @Entity
32  @Table(name = "j3_person_name")
33  public class PersonName implements java.io.Serializable {
34  
35  	private static final long serialVersionUID = 7595828394786128290L;
36  	private Long id;
37  	private Contact contact;
38  	private String langCode;
39  	private String name;
40  
41  	public PersonName() {
42  	}
43  
44  	public PersonName(Contact contact, String name) {
45  		this.contact = contact;
46  		this.name = name;
47  	}
48  	public PersonName(Contact contact, String langCode,
49  			String name) {
50  		this.contact = contact;
51  		this.langCode = langCode;
52  		this.name = name;
53  	}
54  
55  	@Id
56  	@GeneratedValue(strategy=GenerationType.AUTO)
57  	public Long getId() {
58  		return this.id;
59  	}
60  	public void setId(Long id) {
61  		this.id = id;
62  	}
63  
64  	@ManyToOne(fetch = FetchType.LAZY)
65  	@JoinColumn(name = "contact_id", nullable = false)
66  	public Contact getContact() {
67  		return this.contact;
68  	}
69  	public void setContact(Contact contact) {
70  		this.contact = contact;
71  	}
72  
73  	@Column(name = "lang_code", length = 26)
74  	public String getLangCode() {
75  		return this.langCode;
76  	}
77  	public void setLangCode(String langCode) {
78  		this.langCode = langCode;
79  	}
80  
81  	@Column(name = "name", nullable = false)
82  	public String getName() {
83  		return this.name;
84  	}
85  	public void setName(String name) {
86  		this.name = name;
87  	}
88  
89  }