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}) @Retention(RUNTIME)
030: * public @interface Table {
031: * String name() default "";
032: * String catalog() default "";
033: * String schema() default "";
034: * UniqueConstraint[] uniqueConstraints() default {};
035: * }
036: *
037: *
038: *
039: * <p>Java class for table complex type.
040: *
041: * <p>The following schema fragment specifies the expected content contained within this class.
042: *
043: * <pre>
044: * <complexType name="table">
045: * <complexContent>
046: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
047: * <sequence>
048: * <element name="unique-constraint" type="{http://java.sun.com/xml/ns/persistence/orm}unique-constraint" maxOccurs="unbounded" minOccurs="0"/>
049: * </sequence>
050: * <attribute name="catalog" type="{http://www.w3.org/2001/XMLSchema}string" />
051: * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
052: * <attribute name="schema" type="{http://www.w3.org/2001/XMLSchema}string" />
053: * </restriction>
054: * </complexContent>
055: * </complexType>
056: * </pre>
057: *
058: *
059: */
060: @XmlAccessorType(XmlAccessType.FIELD)
061: @XmlType(name="table",propOrder={"uniqueConstraint"})
062: public class Table {
063:
064: @XmlElement(name="unique-constraint")
065: protected List<UniqueConstraint> uniqueConstraint;
066: @XmlAttribute
067: protected String catalog;
068: @XmlAttribute
069: protected String name;
070: @XmlAttribute
071: protected String schema;
072:
073: /**
074: * Gets the value of the uniqueConstraint property.
075: *
076: * <p>
077: * This accessor method returns a reference to the live list,
078: * not a snapshot. Therefore any modification you make to the
079: * returned list will be present inside the JAXB object.
080: * This is why there is not a <CODE>set</CODE> method for the uniqueConstraint property.
081: *
082: * <p>
083: * For example, to add a new item, do as follows:
084: * <pre>
085: * getUniqueConstraint().add(newItem);
086: * </pre>
087: *
088: *
089: * <p>
090: * Objects of the following type(s) are allowed in the list
091: * {@link UniqueConstraint }
092: *
093: *
094: */
095: public List<UniqueConstraint> getUniqueConstraint() {
096: if (uniqueConstraint == null) {
097: uniqueConstraint = new ArrayList<UniqueConstraint>();
098: }
099: return this .uniqueConstraint;
100: }
101:
102: /**
103: * Gets the value of the catalog property.
104: *
105: * @return
106: * possible object is
107: * {@link String }
108: *
109: */
110: public String getCatalog() {
111: return catalog;
112: }
113:
114: /**
115: * Sets the value of the catalog property.
116: *
117: * @param value
118: * allowed object is
119: * {@link String }
120: *
121: */
122: public void setCatalog(String value) {
123: this .catalog = value;
124: }
125:
126: /**
127: * Gets the value of the name property.
128: *
129: * @return
130: * possible object is
131: * {@link String }
132: *
133: */
134: public String getName() {
135: return name;
136: }
137:
138: /**
139: * Sets the value of the name property.
140: *
141: * @param value
142: * allowed object is
143: * {@link String }
144: *
145: */
146: public void setName(String value) {
147: this .name = value;
148: }
149:
150: /**
151: * Gets the value of the schema property.
152: *
153: * @return
154: * possible object is
155: * {@link String }
156: *
157: */
158: public String getSchema() {
159: return schema;
160: }
161:
162: /**
163: * Sets the value of the schema property.
164: *
165: * @param value
166: * allowed object is
167: * {@link String }
168: *
169: */
170: public void setSchema(String value) {
171: this.schema = value;
172: }
173:
174: }
|