001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.openejb.jee.jpa;
017:
018: import java.util.ArrayList;
019: import java.util.List;
020: import javax.xml.bind.annotation.XmlAccessType;
021: import javax.xml.bind.annotation.XmlAccessorType;
022: import javax.xml.bind.annotation.XmlAttribute;
023: import javax.xml.bind.annotation.XmlElement;
024: import javax.xml.bind.annotation.XmlType;
025:
026: /**
027: *
028: *
029: * @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
030: * public @interface TableGenerator {
031: * String name();
032: * String table() default "";
033: * String catalog() default "";
034: * String schema() default "";
035: * String pkColumnName() default "";
036: * String valueColumnName() default "";
037: * String pkColumnValue() default "";
038: * int initialValue() default 0;
039: * int allocationSize() default 50;
040: * UniqueConstraint[] uniqueConstraints() default {};
041: * }
042: *
043: *
044: *
045: * <p>Java class for table-generator complex type.
046: *
047: * <p>The following schema fragment specifies the expected content contained within this class.
048: *
049: * <pre>
050: * <complexType name="table-generator">
051: * <complexContent>
052: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
053: * <sequence>
054: * <element name="unique-constraint" type="{http://java.sun.com/xml/ns/persistence/orm}unique-constraint" maxOccurs="unbounded" minOccurs="0"/>
055: * </sequence>
056: * <attribute name="allocation-size" type="{http://www.w3.org/2001/XMLSchema}int" />
057: * <attribute name="catalog" type="{http://www.w3.org/2001/XMLSchema}string" />
058: * <attribute name="initial-value" type="{http://www.w3.org/2001/XMLSchema}int" />
059: * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
060: * <attribute name="pk-column-name" type="{http://www.w3.org/2001/XMLSchema}string" />
061: * <attribute name="pk-column-value" type="{http://www.w3.org/2001/XMLSchema}string" />
062: * <attribute name="schema" type="{http://www.w3.org/2001/XMLSchema}string" />
063: * <attribute name="table" type="{http://www.w3.org/2001/XMLSchema}string" />
064: * <attribute name="value-column-name" type="{http://www.w3.org/2001/XMLSchema}string" />
065: * </restriction>
066: * </complexContent>
067: * </complexType>
068: * </pre>
069: *
070: *
071: */
072: @XmlAccessorType(XmlAccessType.FIELD)
073: @XmlType(name="table-generator",propOrder={"uniqueConstraint"})
074: public class TableGenerator {
075:
076: @XmlElement(name="unique-constraint")
077: protected List<UniqueConstraint> uniqueConstraint;
078: @XmlAttribute(name="allocation-size")
079: protected Integer allocationSize;
080: @XmlAttribute
081: protected String catalog;
082: @XmlAttribute(name="initial-value")
083: protected Integer initialValue;
084: @XmlAttribute(required=true)
085: protected String name;
086: @XmlAttribute(name="pk-column-name")
087: protected String pkColumnName;
088: @XmlAttribute(name="pk-column-value")
089: protected String pkColumnValue;
090: @XmlAttribute
091: protected String schema;
092: @XmlAttribute
093: protected String table;
094: @XmlAttribute(name="value-column-name")
095: protected String valueColumnName;
096:
097: /**
098: * Gets the value of the uniqueConstraint 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 uniqueConstraint property.
105: *
106: * <p>
107: * For example, to add a new item, do as follows:
108: * <pre>
109: * getUniqueConstraint().add(newItem);
110: * </pre>
111: *
112: *
113: * <p>
114: * Objects of the following type(s) are allowed in the list
115: * {@link UniqueConstraint }
116: *
117: *
118: */
119: public List<UniqueConstraint> getUniqueConstraint() {
120: if (uniqueConstraint == null) {
121: uniqueConstraint = new ArrayList<UniqueConstraint>();
122: }
123: return this .uniqueConstraint;
124: }
125:
126: /**
127: * Gets the value of the allocationSize property.
128: *
129: * @return
130: * possible object is
131: * {@link Integer }
132: *
133: */
134: public Integer getAllocationSize() {
135: return allocationSize;
136: }
137:
138: /**
139: * Sets the value of the allocationSize property.
140: *
141: * @param value
142: * allowed object is
143: * {@link Integer }
144: *
145: */
146: public void setAllocationSize(Integer value) {
147: this .allocationSize = value;
148: }
149:
150: /**
151: * Gets the value of the catalog property.
152: *
153: * @return
154: * possible object is
155: * {@link String }
156: *
157: */
158: public String getCatalog() {
159: return catalog;
160: }
161:
162: /**
163: * Sets the value of the catalog property.
164: *
165: * @param value
166: * allowed object is
167: * {@link String }
168: *
169: */
170: public void setCatalog(String value) {
171: this .catalog = value;
172: }
173:
174: /**
175: * Gets the value of the initialValue property.
176: *
177: * @return
178: * possible object is
179: * {@link Integer }
180: *
181: */
182: public Integer getInitialValue() {
183: return initialValue;
184: }
185:
186: /**
187: * Sets the value of the initialValue property.
188: *
189: * @param value
190: * allowed object is
191: * {@link Integer }
192: *
193: */
194: public void setInitialValue(Integer value) {
195: this .initialValue = value;
196: }
197:
198: /**
199: * Gets the value of the name property.
200: *
201: * @return
202: * possible object is
203: * {@link String }
204: *
205: */
206: public String getName() {
207: return name;
208: }
209:
210: /**
211: * Sets the value of the name property.
212: *
213: * @param value
214: * allowed object is
215: * {@link String }
216: *
217: */
218: public void setName(String value) {
219: this .name = value;
220: }
221:
222: /**
223: * Gets the value of the pkColumnName property.
224: *
225: * @return
226: * possible object is
227: * {@link String }
228: *
229: */
230: public String getPkColumnName() {
231: return pkColumnName;
232: }
233:
234: /**
235: * Sets the value of the pkColumnName property.
236: *
237: * @param value
238: * allowed object is
239: * {@link String }
240: *
241: */
242: public void setPkColumnName(String value) {
243: this .pkColumnName = value;
244: }
245:
246: /**
247: * Gets the value of the pkColumnValue property.
248: *
249: * @return
250: * possible object is
251: * {@link String }
252: *
253: */
254: public String getPkColumnValue() {
255: return pkColumnValue;
256: }
257:
258: /**
259: * Sets the value of the pkColumnValue property.
260: *
261: * @param value
262: * allowed object is
263: * {@link String }
264: *
265: */
266: public void setPkColumnValue(String value) {
267: this .pkColumnValue = value;
268: }
269:
270: /**
271: * Gets the value of the schema property.
272: *
273: * @return
274: * possible object is
275: * {@link String }
276: *
277: */
278: public String getSchema() {
279: return schema;
280: }
281:
282: /**
283: * Sets the value of the schema property.
284: *
285: * @param value
286: * allowed object is
287: * {@link String }
288: *
289: */
290: public void setSchema(String value) {
291: this .schema = value;
292: }
293:
294: /**
295: * Gets the value of the table property.
296: *
297: * @return
298: * possible object is
299: * {@link String }
300: *
301: */
302: public String getTable() {
303: return table;
304: }
305:
306: /**
307: * Sets the value of the table property.
308: *
309: * @param value
310: * allowed object is
311: * {@link String }
312: *
313: */
314: public void setTable(String value) {
315: this .table = value;
316: }
317:
318: /**
319: * Gets the value of the valueColumnName property.
320: *
321: * @return
322: * possible object is
323: * {@link String }
324: *
325: */
326: public String getValueColumnName() {
327: return valueColumnName;
328: }
329:
330: /**
331: * Sets the value of the valueColumnName property.
332: *
333: * @param value
334: * allowed object is
335: * {@link String }
336: *
337: */
338: public void setValueColumnName(String value) {
339: this.valueColumnName = value;
340: }
341:
342: }
|