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 OneToOne {
027 * Class targetEntity() default void.class;
028 * CascadeType[] cascade() default {};
029 * FetchType fetch() default EAGER;
030 * boolean optional() default true;
031 * String mappedBy() default "";
032 * }
033 *
034 *
035 *
036 * <p>Java class for one-to-one complex type.
037 *
038 * <p>The following schema fragment specifies the expected content contained within this class.
039 *
040 * <pre>
041 * <complexType name="one-to-one">
042 * <complexContent>
043 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
044 * <sequence>
045 * <choice>
046 * <element name="primary-key-join-column" type="{http://java.sun.com/xml/ns/persistence/orm}primary-key-join-column" maxOccurs="unbounded" minOccurs="0"/>
047 * <element name="join-column" type="{http://java.sun.com/xml/ns/persistence/orm}join-column" maxOccurs="unbounded" minOccurs="0"/>
048 * <element name="join-table" type="{http://java.sun.com/xml/ns/persistence/orm}join-table" 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="optional" type="{http://www.w3.org/2001/XMLSchema}boolean" />
056 * <attribute name="mapped-by" type="{http://www.w3.org/2001/XMLSchema}string" />
057 * </restriction>
058 * </complexContent>
059 * </complexType>
060 * </pre>
061 *
062 *
063 */
064 @XmlAccessorType(XmlAccessType.FIELD)
065 @XmlType(name = "one-to-one", propOrder = {
066 "primaryKeyJoinColumn",
067 "joinColumn",
068 "joinTable",
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 OneToOne implements Cloneable
073 {
074
075 @XmlElement(name = "primary-key-join-column")
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 List<PrimaryKeyJoinColumn> primaryKeyJoinColumn;
078 @XmlElement(name = "join-column")
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 List<JoinColumn> joinColumn;
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 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
085 protected CascadeType cascade;
086 @XmlAttribute(required = true)
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 String name;
089 @XmlAttribute(name = "target-entity")
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 targetEntity;
092 @XmlAttribute
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 FetchType fetch;
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 Boolean optional;
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 OneToOne} instance.
104 *
105 */
106 public OneToOne() {
107 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
108 super();
109 }
110
111 /**
112 * Creates a new {@code OneToOne} instance by deeply copying a given {@code OneToOne} instance.
113 *
114 *
115 * @param o
116 * The instance to copy.
117 * @throws NullPointerException
118 * if {@code o} is {@code null}.
119 */
120 public OneToOne(final OneToOne 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 'OneToOne' from 'null'.");
125 }
126 // 'PrimaryKeyJoinColumn' collection.
127 copyPrimaryKeyJoinColumn(o.getPrimaryKeyJoinColumn(), getPrimaryKeyJoinColumn());
128 // 'JoinColumn' collection.
129 copyJoinColumn(o.getJoinColumn(), getJoinColumn());
130 // CClassInfo: net.sourceforge.jpaxjc.ns.persistence.orm.JoinTable
131 this.joinTable = ((o.getJoinTable() == null)?null:o.getJoinTable().clone());
132 // CClassInfo: net.sourceforge.jpaxjc.ns.persistence.orm.CascadeType
133 this.cascade = ((o.getCascade() == null)?null:o.getCascade().clone());
134 // CBuiltinLeafInfo: java.lang.String
135 this.name = o.getName();
136 // CBuiltinLeafInfo: java.lang.String
137 this.targetEntity = o.getTargetEntity();
138 // CEnumLeafInfo: net.sourceforge.jpaxjc.ns.persistence.orm.FetchType
139 this.fetch = o.getFetch();
140 // CBuiltinLeafInfo: java.lang.Boolean
141 this.optional = o.isOptional();
142 // CBuiltinLeafInfo: java.lang.String
143 this.mappedBy = o.getMappedBy();
144 }
145
146 /**
147 * Gets the value of the primaryKeyJoinColumn property.
148 *
149 * <p>
150 * This accessor method returns a reference to the live list,
151 * not a snapshot. Therefore any modification you make to the
152 * returned list will be present inside the JAXB object.
153 * This is why there is not a <CODE>set</CODE> method for the primaryKeyJoinColumn property.
154 *
155 * <p>
156 * For example, to add a new item, do as follows:
157 * <pre>
158 * getPrimaryKeyJoinColumn().add(newItem);
159 * </pre>
160 *
161 *
162 * <p>
163 * Objects of the following type(s) are allowed in the list
164 * {@link PrimaryKeyJoinColumn }
165 *
166 *
167 */
168 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
169 public List<PrimaryKeyJoinColumn> getPrimaryKeyJoinColumn() {
170 if (primaryKeyJoinColumn == null) {
171 primaryKeyJoinColumn = new ArrayList<PrimaryKeyJoinColumn>();
172 }
173 return this.primaryKeyJoinColumn;
174 }
175
176 /**
177 * Gets the value of the joinColumn property.
178 *
179 * <p>
180 * This accessor method returns a reference to the live list,
181 * not a snapshot. Therefore any modification you make to the
182 * returned list will be present inside the JAXB object.
183 * This is why there is not a <CODE>set</CODE> method for the joinColumn property.
184 *
185 * <p>
186 * For example, to add a new item, do as follows:
187 * <pre>
188 * getJoinColumn().add(newItem);
189 * </pre>
190 *
191 *
192 * <p>
193 * Objects of the following type(s) are allowed in the list
194 * {@link JoinColumn }
195 *
196 *
197 */
198 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
199 public List<JoinColumn> getJoinColumn() {
200 if (joinColumn == null) {
201 joinColumn = new ArrayList<JoinColumn>();
202 }
203 return this.joinColumn;
204 }
205
206 /**
207 * Gets the value of the joinTable property.
208 *
209 * @return
210 * possible object is
211 * {@link JoinTable }
212 *
213 */
214 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
215 public JoinTable getJoinTable() {
216 return joinTable;
217 }
218
219 /**
220 * Sets the value of the joinTable property.
221 *
222 * @param value
223 * allowed object is
224 * {@link JoinTable }
225 *
226 */
227 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
228 public void setJoinTable(JoinTable value) {
229 this.joinTable = value;
230 }
231
232 /**
233 * Gets the value of the cascade property.
234 *
235 * @return
236 * possible object is
237 * {@link CascadeType }
238 *
239 */
240 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
241 public CascadeType getCascade() {
242 return cascade;
243 }
244
245 /**
246 * Sets the value of the cascade property.
247 *
248 * @param value
249 * allowed object is
250 * {@link CascadeType }
251 *
252 */
253 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
254 public void setCascade(CascadeType value) {
255 this.cascade = value;
256 }
257
258 /**
259 * Gets the value of the name property.
260 *
261 * @return
262 * possible object is
263 * {@link String }
264 *
265 */
266 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
267 public String getName() {
268 return name;
269 }
270
271 /**
272 * Sets the value of the name property.
273 *
274 * @param value
275 * allowed object is
276 * {@link String }
277 *
278 */
279 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
280 public void setName(String value) {
281 this.name = value;
282 }
283
284 /**
285 * Gets the value of the targetEntity property.
286 *
287 * @return
288 * possible object is
289 * {@link String }
290 *
291 */
292 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
293 public String getTargetEntity() {
294 return targetEntity;
295 }
296
297 /**
298 * Sets the value of the targetEntity property.
299 *
300 * @param value
301 * allowed object is
302 * {@link String }
303 *
304 */
305 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
306 public void setTargetEntity(String value) {
307 this.targetEntity = value;
308 }
309
310 /**
311 * Gets the value of the fetch property.
312 *
313 * @return
314 * possible object is
315 * {@link FetchType }
316 *
317 */
318 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
319 public FetchType getFetch() {
320 return fetch;
321 }
322
323 /**
324 * Sets the value of the fetch property.
325 *
326 * @param value
327 * allowed object is
328 * {@link FetchType }
329 *
330 */
331 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
332 public void setFetch(FetchType value) {
333 this.fetch = value;
334 }
335
336 /**
337 * Gets the value of the optional property.
338 *
339 * @return
340 * possible object is
341 * {@link Boolean }
342 *
343 */
344 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
345 public Boolean isOptional() {
346 return optional;
347 }
348
349 /**
350 * Sets the value of the optional property.
351 *
352 * @param value
353 * allowed object is
354 * {@link Boolean }
355 *
356 */
357 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
358 public void setOptional(Boolean value) {
359 this.optional = value;
360 }
361
362 /**
363 * Gets the value of the mappedBy property.
364 *
365 * @return
366 * possible object is
367 * {@link String }
368 *
369 */
370 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
371 public String getMappedBy() {
372 return mappedBy;
373 }
374
375 /**
376 * Sets the value of the mappedBy property.
377 *
378 * @param value
379 * allowed object is
380 * {@link String }
381 *
382 */
383 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
384 public void setMappedBy(String value) {
385 this.mappedBy = value;
386 }
387
388 /**
389 * Copies all values of property {@code PrimaryKeyJoinColumn} deeply.
390 *
391 * @param target
392 * The target to copy {@code source} to.
393 * @param source
394 * The source to copy from.
395 * @throws NullPointerException
396 * if {@code source} or {@code target} is {@code null}.
397 */
398 @SuppressWarnings("unchecked")
399 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
400 private static void copyPrimaryKeyJoinColumn(final List<PrimaryKeyJoinColumn> source, final List<PrimaryKeyJoinColumn> target) {
401 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
402 if (!source.isEmpty()) {
403 for (Iterator it = source.iterator(); it.hasNext(); ) {
404 final Object next = it.next();
405 if (next instanceof PrimaryKeyJoinColumn) {
406 // CClassInfo: net.sourceforge.jpaxjc.ns.persistence.orm.PrimaryKeyJoinColumn
407 target.add(((PrimaryKeyJoinColumn) next).clone());
408 continue;
409 }
410 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
411 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'PrimaryKeyJoinColumn' of class 'net.sourceforge.jpaxjc.ns.persistence.orm.OneToOne'."));
412 }
413 }
414 }
415
416 /**
417 * Copies all values of property {@code JoinColumn} deeply.
418 *
419 * @param target
420 * The target to copy {@code source} to.
421 * @param source
422 * The source to copy from.
423 * @throws NullPointerException
424 * if {@code source} or {@code target} is {@code null}.
425 */
426 @SuppressWarnings("unchecked")
427 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
428 private static void copyJoinColumn(final List<JoinColumn> source, final List<JoinColumn> target) {
429 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
430 if (!source.isEmpty()) {
431 for (Iterator it = source.iterator(); it.hasNext(); ) {
432 final Object next = it.next();
433 if (next instanceof JoinColumn) {
434 // CClassInfo: net.sourceforge.jpaxjc.ns.persistence.orm.JoinColumn
435 target.add(((JoinColumn) next).clone());
436 continue;
437 }
438 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
439 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'JoinColumn' of class 'net.sourceforge.jpaxjc.ns.persistence.orm.OneToOne'."));
440 }
441 }
442 }
443
444 /**
445 * Creates and returns a deep copy of this object.
446 *
447 *
448 * @return
449 * A deep copy of this object.
450 */
451 @Override
452 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
453 public OneToOne clone() {
454 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
455 return new OneToOne(this);
456 }
457
458 }