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   * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
31   */
32  @Entity
33  @Table(name = "j3_business_identifier")
34  public class BusinessIdentifier implements java.io.Serializable {
35  
36  	private static final long serialVersionUID = -4262205627713188502L;
37  	private Long id;
38  	private BusinessEntity businessEntity;
39  	private String tmodelKeyRef;
40  	private String keyName;
41  	private String keyValue;
42  
43  	public BusinessIdentifier() {
44  	}
45  
46  	public BusinessIdentifier(BusinessEntity businessEntity, String keyValue) {
47  		this.businessEntity = businessEntity;
48  		this.keyValue = keyValue;
49  	}
50  	public BusinessIdentifier(BusinessEntity businessEntity, String tmodelKeyRef, String keyName,
51  			String keyValue) {
52  		this.businessEntity = businessEntity;
53  		this.tmodelKeyRef = tmodelKeyRef;
54  		this.keyName = keyName;
55  		this.keyValue = keyValue;
56  	}
57  
58  	@Id
59  	@GeneratedValue(strategy=GenerationType.AUTO)
60  	public Long getId() {
61  		return this.id;
62  	}
63  	public void setId(Long id) {
64  		this.id = id;
65  	}
66  
67  	@ManyToOne(fetch = FetchType.LAZY)
68  	@JoinColumn(name = "entity_key", nullable = false)
69  	public BusinessEntity getBusinessEntity() {
70  		return this.businessEntity;
71  	}
72  	public void setBusinessEntity(BusinessEntity businessEntity) {
73  		this.businessEntity = businessEntity;
74  	}
75  
76  	@Column(name = "tmodel_key_ref", length = 255)
77  	public String getTmodelKeyRef() {
78  		return this.tmodelKeyRef;
79  	}
80  	public void setTmodelKeyRef(String tmodelKeyRef) {
81  		this.tmodelKeyRef = tmodelKeyRef;
82  	}
83  
84  	@Column(name = "key_name")
85  	public String getKeyName() {
86  		return this.keyName;
87  	}
88  	public void setKeyName(String keyName) {
89  		this.keyName = keyName;
90  	}
91  
92  	@Column(name = "key_value", nullable = false)
93  	public String getKeyValue() {
94  		return this.keyValue;
95  	}
96  	public void setKeyValue(String keyValue) {
97  		this.keyValue = keyValue;
98  	}
99  
100 }