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