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({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
026     *         public @interface AssociationOverride {
027     *           String name();
028     *           JoinColumn[] joinColumns();
029     *         }
030     * 
031     *       
032     * 
033     * <p>Java class for association-override complex type.
034     * 
035     * <p>The following schema fragment specifies the expected content contained within this class.
036     * 
037     * <pre>
038     * &lt;complexType name="association-override">
039     *   &lt;complexContent>
040     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
041     *       &lt;sequence>
042     *         &lt;element name="join-column" type="{http://java.sun.com/xml/ns/persistence/orm}join-column" maxOccurs="unbounded"/>
043     *       &lt;/sequence>
044     *       &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
045     *     &lt;/restriction>
046     *   &lt;/complexContent>
047     * &lt;/complexType>
048     * </pre>
049     * 
050     * 
051     */
052    @XmlAccessorType(XmlAccessType.FIELD)
053    @XmlType(name = "association-override", propOrder = {
054        "joinColumn"
055    })
056    @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
057    public class AssociationOverride implements Cloneable
058    {
059    
060        @XmlElement(name = "join-column", required = true)
061        @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
062        protected List<JoinColumn> joinColumn;
063        @XmlAttribute(required = true)
064        @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
065        protected String name;
066    
067        /**
068         * Creates a new {@code AssociationOverride} instance.
069         * 
070         */
071        public AssociationOverride() {
072            // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
073            super();
074        }
075    
076        /**
077         * Creates a new {@code AssociationOverride} instance by deeply copying a given {@code AssociationOverride} instance.
078         * 
079         * 
080         * @param o
081         *     The instance to copy.
082         * @throws NullPointerException
083         *     if {@code o} is {@code null}.
084         */
085        public AssociationOverride(final AssociationOverride o) {
086            // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
087            super();
088            if (o == null) {
089                throw new NullPointerException("Cannot create a copy of 'AssociationOverride' from 'null'.");
090            }
091            // 'JoinColumn' collection.
092            copyJoinColumn(o.getJoinColumn(), getJoinColumn());
093            // CBuiltinLeafInfo: java.lang.String
094            this.name = o.getName();
095        }
096    
097        /**
098         * Gets the value of the joinColumn property.
099         * 
100         * <p>
101         * This accessor method returns a reference to the live list,
102         * not a snapshot. Therefore any modification you make to the
103         * returned list will be present inside the JAXB object.
104         * This is why there is not a <CODE>set</CODE> method for the joinColumn property.
105         * 
106         * <p>
107         * For example, to add a new item, do as follows:
108         * <pre>
109         *    getJoinColumn().add(newItem);
110         * </pre>
111         * 
112         * 
113         * <p>
114         * Objects of the following type(s) are allowed in the list
115         * {@link JoinColumn }
116         * 
117         * 
118         */
119        @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
120        public List<JoinColumn> getJoinColumn() {
121            if (joinColumn == null) {
122                joinColumn = new ArrayList<JoinColumn>();
123            }
124            return this.joinColumn;
125        }
126    
127        /**
128         * Gets the value of the name property.
129         * 
130         * @return
131         *     possible object is
132         *     {@link String }
133         *     
134         */
135        @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
136        public String getName() {
137            return name;
138        }
139    
140        /**
141         * Sets the value of the name property.
142         * 
143         * @param value
144         *     allowed object is
145         *     {@link String }
146         *     
147         */
148        @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
149        public void setName(String value) {
150            this.name = value;
151        }
152    
153        /**
154         * Copies all values of property {@code JoinColumn} deeply.
155         * 
156         * @param target
157         *     The target to copy {@code source} to.
158         * @param source
159         *     The source to copy from.
160         * @throws NullPointerException
161         *     if {@code source} or {@code target} is {@code null}.
162         */
163        @SuppressWarnings("unchecked")
164        @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
165        private static void copyJoinColumn(final List<JoinColumn> source, final List<JoinColumn> target) {
166            // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
167            if (!source.isEmpty()) {
168                for (Iterator it = source.iterator(); it.hasNext(); ) {
169                    final Object next = it.next();
170                    if (next instanceof JoinColumn) {
171                        // CClassInfo: net.sourceforge.jpaxjc.ns.persistence.orm.JoinColumn
172                        target.add(((JoinColumn) next).clone());
173                        continue;
174                    }
175                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
176                    throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'JoinColumn' of class 'net.sourceforge.jpaxjc.ns.persistence.orm.AssociationOverride'."));
177                }
178            }
179        }
180    
181        /**
182         * Creates and returns a deep copy of this object.
183         * 
184         * 
185         * @return
186         *     A deep copy of this object.
187         */
188        @Override
189        @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-08-18T10:46:56+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
190        public AssociationOverride clone() {
191            // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
192            return new AssociationOverride(this);
193        }
194    
195    }