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