This project has retired. For details please refer to its Attic page.
KeyedReferenceGroup 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.OrderBy;
32  import javax.persistence.Table;
33  
34  /**
35   * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
36   */
37  @Entity
38  @Table(name = "j3_keyed_reference_group")
39  public class KeyedReferenceGroup implements java.io.Serializable {
40  
41  	private static final long serialVersionUID = 837654280200149969L;
42  	private Long id;
43  	private CategoryBag categoryBag;
44  	private String tmodelKey;
45  	private List<KeyedReference> keyedReferences = new ArrayList<KeyedReference>(0);
46  	
47  
48  	public KeyedReferenceGroup() {
49  	}
50  
51  	public KeyedReferenceGroup(CategoryBag categoryBag, String tmodelKey) {
52  		this.categoryBag = categoryBag;
53  		this.tmodelKey = tmodelKey;
54  	}
55  
56  	@Id
57  	@GeneratedValue(strategy=GenerationType.AUTO)
58  	public Long getId() {
59  		return this.id;
60  	}
61  	public void setId(Long id) {
62  		this.id = id;
63  	}
64  	
65  	@Column(name = "tmodel_key", length = 255)
66  	public String getTmodelKey() {
67  		return this.tmodelKey;
68  	}
69  	public void setTmodelKey(String tmodelKey) {
70  		this.tmodelKey = tmodelKey;
71  	}
72  
73  	@ManyToOne(fetch = FetchType.LAZY)
74  	@JoinColumn(name = "category_bag_id", nullable = false)
75  	public CategoryBag getCategoryBag() {
76  		return this.categoryBag;
77  	}
78  	public void setCategoryBag(CategoryBag categoryBag) {
79  		this.categoryBag = categoryBag;
80  	}
81  	
82  	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "keyedReferenceGroup")
83  	@OrderBy
84  	public List<KeyedReference> getKeyedReferences() {
85  		return keyedReferences;
86  	}
87  	public void setKeyedReferences(List<KeyedReference> keyedReferences) {
88  		this.keyedReferences = keyedReferences;
89  	}
90  
91  }