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_keyed_reference")
33  public class KeyedReference implements java.io.Serializable {
34  
35  	private static final long serialVersionUID = 6594148893695178191L;
36  	private Long id;
37  	private CategoryBag categoryBag;
38  	private KeyedReferenceGroup keyedReferenceGroup;
39  	private String tmodelKeyRef;
40  	private String keyName;
41  	private String keyValue;
42  
43  	public KeyedReference() {
44  	}
45  
46  	public KeyedReference(CategoryBag categoryBag, String keyValue) {
47  		this.categoryBag = categoryBag;
48  		this.keyValue = keyValue;
49  	}
50  	
51  	public KeyedReference(KeyedReferenceGroup keyedReferenceGroup, String tmodelKeyRef,
52  			String keyName, String keyValue) {
53  		this.keyedReferenceGroup = keyedReferenceGroup;
54  		this.tmodelKeyRef = tmodelKeyRef;
55  		this.keyName = keyName;
56  		this.keyValue = keyValue;
57  	}
58  	
59  	public KeyedReference(CategoryBag categoryBag, String tmodelKeyRef,
60  			String keyName, String keyValue) {
61  		this.categoryBag = categoryBag;
62  		this.tmodelKeyRef = tmodelKeyRef;
63  		this.keyName = keyName;
64  		this.keyValue = keyValue;
65  	}
66  
67  	@Id
68  	@GeneratedValue(strategy=GenerationType.AUTO)
69  	public Long getId() {
70  		return this.id;
71  	}
72  	public void setId(Long id) {
73  		this.id = id;
74  	}
75  
76  	@ManyToOne(fetch = FetchType.LAZY)
77  	@JoinColumn(name = "category_bag_id", nullable = true)
78  	public CategoryBag getCategoryBag() {
79  		return this.categoryBag;
80  	}
81  	public void setCategoryBag(CategoryBag categoryBag) {
82  		this.categoryBag = categoryBag;
83  	}
84  	
85  	@ManyToOne(fetch = FetchType.LAZY)
86  	@JoinColumn(name = "keyed_reference_group_id", nullable = true)
87  	public KeyedReferenceGroup getKeyedReferenceGroup() {
88  		return keyedReferenceGroup;
89  	}
90  	public void setKeyedReferenceGroup(KeyedReferenceGroup keyedReferenceGroup) {
91  		this.keyedReferenceGroup = keyedReferenceGroup;
92  	}
93  
94  	@Column(name = "tmodel_key_ref", length = 255)
95  	public String getTmodelKeyRef() {
96  		return this.tmodelKeyRef;
97  	}
98  	public void setTmodelKeyRef(String tmodelKeyRef) {
99  		this.tmodelKeyRef = tmodelKeyRef;
100 	}
101 
102 	@Column(name = "key_name", length = 255)
103 	public String getKeyName() {
104 		return this.keyName;
105 	}
106 	public void setKeyName(String keyName) {
107 		this.keyName = keyName;
108 	}
109 
110 	@Column(name = "key_value", nullable = false, length = 255)
111 	public String getKeyValue() {
112 		return this.keyValue;
113 	}
114 	public void setKeyValue(String keyValue) {
115 		this.keyValue = keyValue;
116 	}
117 
118 }