This project has retired. For details please refer to its Attic page.
Contact 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  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  import javax.persistence.CascadeType;
22  import javax.persistence.Column;
23  import javax.persistence.Entity;
24  import javax.persistence.FetchType;
25  import javax.persistence.GeneratedValue;
26  import javax.persistence.GenerationType;
27  import javax.persistence.Id;
28  import javax.persistence.JoinColumn;
29  import javax.persistence.ManyToOne;
30  import javax.persistence.OneToMany;
31  import javax.persistence.OneToOne;
32  import javax.persistence.OrderBy;
33  import javax.persistence.Table;
34  
35  /**
36   * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
37   * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
38   */
39  @Entity
40  @Table(name = "j3_contact")
41  public class Contact implements java.io.Serializable {
42  
43  	private static final long serialVersionUID = 3350341195850056589L;
44  	private Long id;
45  	private BusinessEntity businessEntity;
46          private ReplicationConfiguration replicationConfigSerial;
47  	private String useType;
48  	private List<PersonName> personNames = new ArrayList<PersonName>(0);
49  	private List<ContactDescr> contactDescrs = new ArrayList<ContactDescr>(0);
50  	private List<Email> emails = new ArrayList<Email>(0);
51  	private List<Phone> phones = new ArrayList<Phone>(0);
52  	private List<Address> addresses = new ArrayList<Address>(0);
53  
54  	public Contact() {
55  	}
56  
57  	public Contact(BusinessEntity businessEntity) {
58  		this.businessEntity = businessEntity;
59  	}
60  	public Contact(BusinessEntity businessEntity, String useType,
61  			List<PersonName> personNames, List<ContactDescr> contactDescrs,
62  			List<Email> emails, List<Phone> phones, List<Address> addresses) {
63  		this.businessEntity = businessEntity;
64  		this.useType = useType;
65  		this.personNames = personNames;
66  		this.contactDescrs = contactDescrs;
67  		this.emails = emails;
68  		this.phones = phones;
69  		this.addresses = addresses;
70  	}
71  
72          @OneToOne(fetch = FetchType.LAZY)
73  	@JoinColumn(name = "replicationCfgId", nullable = true)
74          public ReplicationConfiguration getReplicationConfigId() {
75  		return this.replicationConfigSerial;
76  	}
77  	public void setReplicationConfigId(ReplicationConfiguration id) {
78  		this.replicationConfigSerial = id;
79  	}
80          
81  	@Id
82  	@GeneratedValue(strategy=GenerationType.AUTO)
83  	public Long getId() {
84  		return this.id;
85  	}
86  	public void setId(Long id) {
87  		this.id = id;
88  	}
89  
90  	@ManyToOne(fetch = FetchType.LAZY)
91  	@JoinColumn(name = "entity_key", nullable = true)
92  	public BusinessEntity getBusinessEntity() {
93  		return this.businessEntity;
94  	}
95  	public void setBusinessEntity(BusinessEntity businessEntity) {
96  		this.businessEntity = businessEntity;
97  	}
98  
99  	@Column(name = "use_type")
100 	public String getUseType() {
101 		return this.useType;
102 	}
103 	public void setUseType(String useType) {
104 		this.useType = useType;
105 	}
106 
107 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "contact")
108 	@OrderBy
109 	public List<PersonName> getPersonNames() {
110 		return this.personNames;
111 	}
112 	public void setPersonNames(List<PersonName> personNames) {
113 		this.personNames = personNames;
114 	}
115 	
116 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "contact")
117 	@OrderBy
118 	public List<ContactDescr> getContactDescrs() {
119 		return this.contactDescrs;
120 	}
121 	public void setContactDescrs(List<ContactDescr> contactDescrs) {
122 		this.contactDescrs = contactDescrs;
123 	}
124 
125 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "contact")
126 	@OrderBy
127 	public List<Email> getEmails() {
128 		return this.emails;
129 	}
130 	public void setEmails(List<Email> emails) {
131 		this.emails = emails;
132 	}
133 
134 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "contact")
135 	@OrderBy
136 	public List<Phone> getPhones() {
137 		return this.phones;
138 	}
139 	public void setPhones(List<Phone> phones) {
140 		this.phones = phones;
141 	}
142 
143 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "contact")
144 	@OrderBy
145 	public List<Address> getAddresses() {
146 		return this.addresses;
147 	}
148 	public void setAddresses(List<Address> addresses) {
149 		this.addresses = addresses;
150 	}
151 
152 }