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.Lob;
30  import javax.persistence.ManyToOne;
31  import javax.persistence.OneToMany;
32  import javax.persistence.OrderBy;
33  import javax.persistence.Table;
34  
35  /**
36   * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
37   * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
38   */
39  @Entity
40  @Table(name = "j3_tmodel_instance_info")
41  public class TmodelInstanceInfo implements java.io.Serializable {
42  
43  	private static final long serialVersionUID = -6375499794977257231L;
44  	private Long id;
45  	private BindingTemplate bindingTemplate;
46  	private String tmodelKey;
47  	private List<TmodelInstanceInfoDescr> tmodelInstanceInfoDescrs = new ArrayList<TmodelInstanceInfoDescr>(0);
48  
49  	private String instanceParms;
50  	private List<OverviewDoc> overviewDocs = new ArrayList<OverviewDoc>(0);
51  	private List<InstanceDetailsDescr> instanceDetailsDescrs = new ArrayList<InstanceDetailsDescr>(0);
52  	
53  	public TmodelInstanceInfo() {
54  	}
55  
56  	public TmodelInstanceInfo(BindingTemplate bindingTemplate, String tmodelKey) {
57  		this.bindingTemplate = bindingTemplate;
58  		this.tmodelKey = tmodelKey;
59  	}
60  	public TmodelInstanceInfo(BindingTemplate bindingTemplate, String tmodelKey,
61  			String instanceParms,
62  			List<OverviewDoc> overviewDocs,
63  			List<InstanceDetailsDescr> instanceDetailsDescrs,
64  			List<TmodelInstanceInfoDescr> tmodelInstanceInfoDescrs) {
65  		this.bindingTemplate = bindingTemplate;
66  		this.tmodelKey = tmodelKey;
67  		this.instanceParms = instanceParms;
68  		this.overviewDocs = overviewDocs;
69  		this.instanceDetailsDescrs = instanceDetailsDescrs;
70  		this.tmodelInstanceInfoDescrs = tmodelInstanceInfoDescrs;
71  	}
72  
73  	@Id
74  	@GeneratedValue(strategy=GenerationType.AUTO)
75  	public Long getId() {
76  		return this.id;
77  	}
78  	public void setId(Long id) {
79  		this.id = id;
80  	}
81  
82  	@ManyToOne(fetch = FetchType.LAZY)
83  	@JoinColumn(name = "entity_key", nullable = false)
84  	public BindingTemplate getBindingTemplate() {
85  		return this.bindingTemplate;
86  	}
87  	public void setBindingTemplate(BindingTemplate bindingTemplate) {
88  		this.bindingTemplate = bindingTemplate;
89  	}
90  
91  	@Column(name = "tmodel_key", nullable = false, length = 255)
92  	public String getTmodelKey() {
93  		return this.tmodelKey;
94  	}
95  	public void setTmodelKey(String tmodelKey) {
96  		this.tmodelKey = tmodelKey;
97  	}
98  
99          @Lob
100 	@Column(name = "instance_parms", length = 8192)
101 	public String getInstanceParms() {
102 		return this.instanceParms;
103 	}
104 	public void setInstanceParms(String instanceParms) {
105 		this.instanceParms = instanceParms;
106 	}
107 
108 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tmodelInstanceInfo")
109 	@OrderBy
110 	public List<OverviewDoc> getOverviewDocs() {
111 		return this.overviewDocs;
112 	}
113 	public void setOverviewDocs(
114 			List<OverviewDoc> overviewDocs) {
115 		this.overviewDocs = overviewDocs;
116 	}
117 
118 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tmodelInstanceInfo")
119 	@OrderBy
120 	public List<InstanceDetailsDescr> getInstanceDetailsDescrs() {
121 		return this.instanceDetailsDescrs;
122 	}
123 	public void setInstanceDetailsDescrs(
124 			List<InstanceDetailsDescr> instanceDetailsDescrs) {
125 		this.instanceDetailsDescrs = instanceDetailsDescrs;
126 	}
127 
128 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tmodelInstanceInfo")
129 	@OrderBy
130 	public List<TmodelInstanceInfoDescr> getTmodelInstanceInfoDescrs() {
131 		return this.tmodelInstanceInfoDescrs;
132 	}
133 	public void setTmodelInstanceInfoDescrs(
134 			List<TmodelInstanceInfoDescr> tmodelInstanceInfoDescrs) {
135 		this.tmodelInstanceInfoDescrs = tmodelInstanceInfoDescrs;
136 	}
137 
138 }