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   * @author <a href="mailto:tcunning@apache.org">Tom Cunningham</a>
37   */
38  @Entity
39  @Table(name = "j3_overview_doc")
40  public class OverviewDoc implements java.io.Serializable {
41  
42  	private static final long serialVersionUID = 4560091663915489899L;
43  	private Long id;
44  	private TmodelInstanceInfo tmodelInstanceInfo;
45  	private Tmodel tmodel;
46  	private String overviewUrl;
47  	private String overviewUrlUseType;
48  	private List<OverviewDocDescr> overviewDocDescrs = new ArrayList<OverviewDocDescr>(0);
49  
50  	public OverviewDoc() {
51  	}
52  
53  	public OverviewDoc(TmodelInstanceInfo tmodelInstanceInfo) {
54  		this.tmodelInstanceInfo = tmodelInstanceInfo;
55  	}
56  	
57  	public OverviewDoc(Tmodel tmodel) {
58  		this.tmodel = tmodel;
59  	}
60  	
61  	public OverviewDoc(TmodelInstanceInfo tmodelInstanceInfo, Tmodel tmodel,
62  			String overviewUrl, String overviewUrlUseType, List<OverviewDocDescr> overviewDocDescrs) {
63  		this.tmodelInstanceInfo = tmodelInstanceInfo;
64  		this.tmodel = tmodel;
65  		this.overviewUrl = overviewUrl;
66  		this.overviewUrlUseType = overviewUrlUseType;
67  		this.overviewDocDescrs = overviewDocDescrs;
68  	}
69  
70  	@Id
71  	@GeneratedValue(strategy=GenerationType.AUTO)
72  	public Long getId() {
73  		return this.id;
74  	}
75  
76  	public void setId(Long id) {
77  		this.id = id;
78  	}
79  
80  	@ManyToOne(fetch = FetchType.LAZY)
81  	@JoinColumn(name = "tomodel_instance_info_id", nullable = true)
82  	public TmodelInstanceInfo getTmodelInstanceInfo() {
83  		return this.tmodelInstanceInfo;
84  	}
85  
86  	public void setTmodelInstanceInfo(TmodelInstanceInfo tmodelInstanceInfo) {
87  		this.tmodelInstanceInfo = tmodelInstanceInfo;
88  	}
89  	
90  	@ManyToOne(fetch = FetchType.LAZY)
91  	@JoinColumn(name = "entity_key", nullable = true)
92  	public Tmodel getTmodel() {
93  		return this.tmodel;
94  	}
95  
96  	public void setTmodel(Tmodel tmodel) {
97  		this.tmodel = tmodel;
98  	}
99  
100 	@Column(name = "overview_url", nullable = true)
101 	public String getOverviewUrl() {
102 		return this.overviewUrl;
103 	}
104 
105 	public void setOverviewUrl(String overviewUrl) {
106 		this.overviewUrl = overviewUrl;
107 	}
108 	
109 	@Column(name = "overview_url_use_type", nullable = true)
110 	public String getOverviewUrlUseType() {
111 		return this.overviewUrlUseType;
112 	}
113 
114 	public void setOverviewUrlUseType(String overviewUrlUseType) {
115 		this.overviewUrlUseType = overviewUrlUseType;
116 	}
117 
118 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "overviewDoc")
119 	@OrderBy
120 	public List<OverviewDocDescr> getOverviewDocDescrs() {
121 		return this.overviewDocDescrs;
122 	}
123 	
124 	public void setOverviewDocDescrs(List<OverviewDocDescr> overviewDocDescrs) {
125 		this.overviewDocDescrs = overviewDocDescrs;
126 	}	
127 }