001 //
002 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
003 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
004 // Any modifications to this file will be lost upon recompilation of the source schema.
005 // Generated on: 2010.08.18 at 10:46:56 PM CEST
006 //
007
008
009 package net.sourceforge.jpaxjc.ns.persistence.orm;
010
011 import java.util.ArrayList;
012 import java.util.Iterator;
013 import java.util.List;
014 import javax.annotation.Generated;
015 import javax.xml.bind.annotation.XmlAccessType;
016 import javax.xml.bind.annotation.XmlAccessorType;
017 import javax.xml.bind.annotation.XmlAttribute;
018 import javax.xml.bind.annotation.XmlElement;
019 import javax.xml.bind.annotation.XmlType;
020
021
022 /**
023 *
024 *
025 * @Target({METHOD, FIELD}) @Retention(RUNTIME)
026 * public @interface OneToMany {
027 * Class targetEntity() default void.class;
028 * CascadeType[] cascade() default {};
029 * FetchType fetch() default LAZY;
030 * String mappedBy() default "";
031 * }
032 *
033 *
034 *
035 * <p>Java class for one-to-many complex type.
036 *
037 * <p>The following schema fragment specifies the expected content contained within this class.
038 *
039 * <pre>
040 * <complexType name="one-to-many">
041 * <complexContent>
042 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
043 * <sequence>
044 * <element name="order-by" type="{http://java.sun.com/xml/ns/persistence/orm}order-by" minOccurs="0"/>
045 * <element name="map-key" type="{http://java.sun.com/xml/ns/persistence/orm}map-key" minOccurs="0"/>
046 * <choice>
047 * <element name="join-table" type="{http://java.sun.com/xml/ns/persistence/orm}join-table" minOccurs="0"/>
048 * <element name="join-column" type="{http://java.sun.com/xml/ns/persistence/orm}join-column" maxOccurs="unbounded" minOccurs="0"/>
049 * </choice>
050 * <element name="cascade" type="{http://java.sun.com/xml/ns/persistence/orm}cascade-type" minOccurs="0"/>
051 * </sequence>
052 * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
053 * <attribute name="target-entity" type="{http://www.w3.org/2001/XMLSchema}string" />
054 * <attribute name="fetch" type="{http://java.sun.com/xml/ns/persistence/orm}fetch-type" />
055 * <attribute name="mapped-by" type="{http://www.w3.org/2001/XMLSchema}string" />
056 * </restriction>
057 * </complexContent>
058 * </complexType>
059 * </pre>
060 *
061 *
062 */
063 @XmlAccessorType(XmlAccessType.FIELD)
064 @XmlType(name = "one-to-many", propOrder = {
065 "orderBy",
066 "mapKey",
067 "joinTable",
068 "joinColumn",
069 "cascade"
070 })
071 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
072 public class OneToMany implements Cloneable
073 {
074
075 @XmlElement(name = "order-by")
076 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
077 protected String orderBy;
078 @XmlElement(name = "map-key")
079 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
080 protected MapKey mapKey;
081 @XmlElement(name = "join-table")
082 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
083 protected JoinTable joinTable;
084 @XmlElement(name = "join-column")
085 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
086 protected List<JoinColumn> joinColumn;
087 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
088 protected CascadeType cascade;
089 @XmlAttribute(required = true)
090 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
091 protected String name;
092 @XmlAttribute(name = "target-entity")
093 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
094 protected String targetEntity;
095 @XmlAttribute
096 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
097 protected FetchType fetch;
098 @XmlAttribute(name = "mapped-by")
099 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
100 protected String mappedBy;
101
102 /**
103 * Creates a new {@code OneToMany} instance.
104 *
105 */
106 public OneToMany() {
107 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
108 super();
109 }
110
111 /**
112 * Creates a new {@code OneToMany} instance by deeply copying a given {@code OneToMany} instance.
113 *
114 *
115 * @param o
116 * The instance to copy.
117 * @throws NullPointerException
118 * if {@code o} is {@code null}.
119 */
120 public OneToMany(final OneToMany o) {
121 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
122 super();
123 if (o == null) {
124 throw new NullPointerException("Cannot create a copy of 'OneToMany' from 'null'.");
125 }
126 // CBuiltinLeafInfo: java.lang.String
127 this.orderBy = o.getOrderBy();
128 // CClassInfo: net.sourceforge.jpaxjc.ns.persistence.orm.MapKey
129 this.mapKey = ((o.getMapKey() == null)?null:o.getMapKey().clone());
130 // CClassInfo: net.sourceforge.jpaxjc.ns.persistence.orm.JoinTable
131 this.joinTable = ((o.getJoinTable() == null)?null:o.getJoinTable().clone());
132 // 'JoinColumn' collection.
133 copyJoinColumn(o.getJoinColumn(), getJoinColumn());
134 // CClassInfo: net.sourceforge.jpaxjc.ns.persistence.orm.CascadeType
135 this.cascade = ((o.getCascade() == null)?null:o.getCascade().clone());
136 // CBuiltinLeafInfo: java.lang.String
137 this.name = o.getName();
138 // CBuiltinLeafInfo: java.lang.String
139 this.targetEntity = o.getTargetEntity();
140 // CEnumLeafInfo: net.sourceforge.jpaxjc.ns.persistence.orm.FetchType
141 this.fetch = o.getFetch();
142 // CBuiltinLeafInfo: java.lang.String
143 this.mappedBy = o.getMappedBy();
144 }
145
146 /**
147 * Gets the value of the orderBy property.
148 *
149 * @return
150 * possible object is
151 * {@link String }
152 *
153 */
154 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
155 public String getOrderBy() {
156 return orderBy;
157 }
158
159 /**
160 * Sets the value of the orderBy property.
161 *
162 * @param value
163 * allowed object is
164 * {@link String }
165 *
166 */
167 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
168 public void setOrderBy(String value) {
169 this.orderBy = value;
170 }
171
172 /**
173 * Gets the value of the mapKey property.
174 *
175 * @return
176 * possible object is
177 * {@link MapKey }
178 *
179 */
180 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
181 public MapKey getMapKey() {
182 return mapKey;
183 }
184
185 /**
186 * Sets the value of the mapKey property.
187 *
188 * @param value
189 * allowed object is
190 * {@link MapKey }
191 *
192 */
193 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
194 public void setMapKey(MapKey value) {
195 this.mapKey = value;
196 }
197
198 /**
199 * Gets the value of the joinTable property.
200 *
201 * @return
202 * possible object is
203 * {@link JoinTable }
204 *
205 */
206 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
207 public JoinTable getJoinTable() {
208 return joinTable;
209 }
210
211 /**
212 * Sets the value of the joinTable property.
213 *
214 * @param value
215 * allowed object is
216 * {@link JoinTable }
217 *
218 */
219 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
220 public void setJoinTable(JoinTable value) {
221 this.joinTable = value;
222 }
223
224 /**
225 * Gets the value of the joinColumn property.
226 *
227 * <p>
228 * This accessor method returns a reference to the live list,
229 * not a snapshot. Therefore any modification you make to the
230 * returned list will be present inside the JAXB object.
231 * This is why there is not a <CODE>set</CODE> method for the joinColumn property.
232 *
233 * <p>
234 * For example, to add a new item, do as follows:
235 * <pre>
236 * getJoinColumn().add(newItem);
237 * </pre>
238 *
239 *
240 * <p>
241 * Objects of the following type(s) are allowed in the list
242 * {@link JoinColumn }
243 *
244 *
245 */
246 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
247 public List<JoinColumn> getJoinColumn() {
248 if (joinColumn == null) {
249 joinColumn = new ArrayList<JoinColumn>();
250 }
251 return this.joinColumn;
252 }
253
254 /**
255 * Gets the value of the cascade property.
256 *
257 * @return
258 * possible object is
259 * {@link CascadeType }
260 *
261 */
262 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
263 public CascadeType getCascade() {
264 return cascade;
265 }
266
267 /**
268 * Sets the value of the cascade property.
269 *
270 * @param value
271 * allowed object is
272 * {@link CascadeType }
273 *
274 */
275 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
276 public void setCascade(CascadeType value) {
277 this.cascade = value;
278 }
279
280 /**
281 * Gets the value of the name property.
282 *
283 * @return
284 * possible object is
285 * {@link String }
286 *
287 */
288 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
289 public String getName() {
290 return name;
291 }
292
293 /**
294 * Sets the value of the name property.
295 *
296 * @param value
297 * allowed object is
298 * {@link String }
299 *
300 */
301 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
302 public void setName(String value) {
303 this.name = value;
304 }
305
306 /**
307 * Gets the value of the targetEntity property.
308 *
309 * @return
310 * possible object is
311 * {@link String }
312 *
313 */
314 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
315 public String getTargetEntity() {
316 return targetEntity;
317 }
318
319 /**
320 * Sets the value of the targetEntity property.
321 *
322 * @param value
323 * allowed object is
324 * {@link String }
325 *
326 */
327 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
328 public void setTargetEntity(String value) {
329 this.targetEntity = value;
330 }
331
332 /**
333 * Gets the value of the fetch property.
334 *
335 * @return
336 * possible object is
337 * {@link FetchType }
338 *
339 */
340 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
341 public FetchType getFetch() {
342 return fetch;
343 }
344
345 /**
346 * Sets the value of the fetch property.
347 *
348 * @param value
349 * allowed object is
350 * {@link FetchType }
351 *
352 */
353 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
354 public void setFetch(FetchType value) {
355 this.fetch = value;
356 }
357
358 /**
359 * Gets the value of the mappedBy property.
360 *
361 * @return
362 * possible object is
363 * {@link String }
364 *
365 */
366 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
367 public String getMappedBy() {
368 return mappedBy;
369 }
370
371 /**
372 * Sets the value of the mappedBy property.
373 *
374 * @param value
375 * allowed object is
376 * {@link String }
377 *
378 */
379 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
380 public void setMappedBy(String value) {
381 this.mappedBy = value;
382 }
383
384 /**
385 * Copies all values of property {@code JoinColumn} deeply.
386 *
387 * @param target
388 * The target to copy {@code source} to.
389 * @param source
390 * The source to copy from.
391 * @throws NullPointerException
392 * if {@code source} or {@code target} is {@code null}.
393 */
394 @SuppressWarnings("unchecked")
395 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
396 private static void copyJoinColumn(final List<JoinColumn> source, final List<JoinColumn> target) {
397 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
398 if (!source.isEmpty()) {
399 for (Iterator it = source.iterator(); it.hasNext(); ) {
400 final Object next = it.next();
401 if (next instanceof JoinColumn) {
402 // CClassInfo: net.sourceforge.jpaxjc.ns.persistence.orm.JoinColumn
403 target.add(((JoinColumn) next).clone());
404 continue;
405 }
406 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
407 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'JoinColumn' of class 'net.sourceforge.jpaxjc.ns.persistence.orm.OneToMany'."));
408 }
409 }
410 }
411
412 /**
413 * Creates and returns a deep copy of this object.
414 *
415 *
416 * @return
417 * A deep copy of this object.
418 */
419 @Override
420 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
421 public OneToMany clone() {
422 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
423 return new OneToMany(this);
424 }
425
426 }