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.Date;
20  import java.util.List;
21  
22  import javax.persistence.CascadeType;
23  import javax.persistence.Entity;
24  import javax.persistence.FetchType;
25  import javax.persistence.OneToMany;
26  import javax.persistence.OneToOne;
27  import javax.persistence.OrderBy;
28  import javax.persistence.Table;
29  
30  /**
31   * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
32   * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
33   */
34  @Entity
35  @Table(name = "j3_business_entity")
36  public class BusinessEntity extends UddiEntity implements java.io.Serializable {
37  
38  	private static final long serialVersionUID = -7353389848796421619L;
39  	private List<Contact> contacts = new ArrayList<Contact>(0);
40  	private List<BusinessIdentifier> businessIdentifiers = new ArrayList<BusinessIdentifier>(0);
41  	private List<PublisherAssertion> publisherAssertionsForFromKey = new ArrayList<PublisherAssertion>(0);
42  	private List<DiscoveryUrl> discoveryUrls = new ArrayList<DiscoveryUrl>(0);
43  	private List<BusinessName> businessNames = new ArrayList<BusinessName>(0);
44  	private List<PublisherAssertion> publisherAssertionsForToKey = new ArrayList<PublisherAssertion>(0);
45  	private BusinessCategoryBag categoryBag;
46  	private List<BusinessService> businessServices = new ArrayList<BusinessService>(0);
47  	private List<BusinessDescr> businessDescrs = new ArrayList<BusinessDescr>(0);
48  	private List<ServiceProjection> serviceProjections = new ArrayList<ServiceProjection>(0);
49          private List<Signature> signatures = new ArrayList<Signature>(0);
50  
51  	public BusinessEntity() {
52  	}
53  
54  	public BusinessEntity(String entityKey, Date modified) {
55  		this.entityKey = entityKey;
56  		this.modified = modified;
57  	}
58  	public BusinessEntity(String entityKey, String authorizedName, 
59  			String operator,
60  			Date modified, List<Contact> contacts,
61  			List<BusinessIdentifier> businessIdentifiers,
62  			List<PublisherAssertion> publisherAssertionsForFromKey,
63  			List<DiscoveryUrl> discoveryUrls, List<BusinessName> businessNames,
64  			List<PublisherAssertion> publisherAssertionsForToKey,
65  			BusinessCategoryBag categoryBag,
66  			List<BusinessService> businessServices,
67  			List<BusinessDescr> businessDescrs) {
68  		this.entityKey = entityKey;
69  		this.authorizedName = authorizedName;
70  		this.modified = modified;
71  		this.contacts = contacts;
72  		this.businessIdentifiers = businessIdentifiers;
73  		this.publisherAssertionsForFromKey = publisherAssertionsForFromKey;
74  		this.discoveryUrls = discoveryUrls;
75  		this.businessNames = businessNames;
76  		this.publisherAssertionsForToKey = publisherAssertionsForToKey;
77  		this.categoryBag = categoryBag;
78  		this.businessServices = businessServices;
79  		this.businessDescrs = businessDescrs;
80  	}
81  
82  	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
83  	@OrderBy
84  	public List<Contact> getContacts() {
85                  if (this.contacts==null)
86                          this.contacts = new ArrayList<Contact>();
87  		return this.contacts;
88  	}
89  	public void setContacts(List<Contact> contacts) {
90  		this.contacts = contacts;
91  	}
92  
93  	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
94  	@OrderBy
95  	public List<BusinessIdentifier> getBusinessIdentifiers() {
96  		return this.businessIdentifiers;
97  	}
98  	public void setBusinessIdentifiers(
99  			List<BusinessIdentifier> businessIdentifiers) {
100 		this.businessIdentifiers = businessIdentifiers;
101 	}
102 
103 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntityByFromKey")
104 	@OrderBy
105 	public List<PublisherAssertion> getPublisherAssertionsForFromKey() {
106 		return this.publisherAssertionsForFromKey;
107 	}
108 	public void setPublisherAssertionsForFromKey(
109 			List<PublisherAssertion> publisherAssertionsForFromKey) {
110 		this.publisherAssertionsForFromKey = publisherAssertionsForFromKey;
111 	}
112 
113 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
114 	@OrderBy
115 	public List<DiscoveryUrl> getDiscoveryUrls() {
116 		return this.discoveryUrls;
117 	}
118 	public void setDiscoveryUrls(List<DiscoveryUrl> discoveryUrls) {
119 		this.discoveryUrls = discoveryUrls;
120 	}
121 
122 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
123 	@OrderBy
124 	public List<BusinessName> getBusinessNames() {
125 		return this.businessNames;
126 	}
127 	public void setBusinessNames(List<BusinessName> businessNames) {
128 		this.businessNames = businessNames;
129 	}
130 
131 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntityByToKey")
132 	@OrderBy
133 	public List<PublisherAssertion> getPublisherAssertionsForToKey() {
134 		return this.publisherAssertionsForToKey;
135 	}
136 	public void setPublisherAssertionsForToKey(
137 			List<PublisherAssertion> publisherAssertionsForToKey) {
138 		this.publisherAssertionsForToKey = publisherAssertionsForToKey;
139 	}
140 
141 	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
142 	public BusinessCategoryBag getCategoryBag() {
143 		return this.categoryBag;
144 	}
145 	public void setCategoryBag(BusinessCategoryBag categoryBag) {
146 		this.categoryBag = categoryBag;
147 	}
148 	
149 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
150 	@OrderBy
151 	public List<BusinessService> getBusinessServices() {
152 		return this.businessServices;
153 	}
154 	public void setBusinessServices(List<BusinessService> businessServices) {
155 		this.businessServices = businessServices;
156 	}
157 
158 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
159 	@OrderBy
160 	public List<BusinessDescr> getBusinessDescrs() {
161 		return this.businessDescrs;
162 	}
163 	public void setBusinessDescrs(List<BusinessDescr> businessDescrs) {
164 		this.businessDescrs = businessDescrs;
165 	}
166 
167 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
168 	public List<ServiceProjection> getServiceProjections() {
169 		return serviceProjections;
170 	}
171 	public void setServiceProjections(List<ServiceProjection> serviceProjections) {
172 		this.serviceProjections = serviceProjections;
173 	}
174 
175         @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
176 	@OrderBy
177         public List<Signature> getSignatures() {
178                 return signatures;
179         }
180 
181         public void setSignatures(List<Signature> signatures) {
182                 this.signatures = signatures;
183         }
184 	
185 	
186 }