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