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({METHOD, FIELD}) @Retention(RUNTIME)
030: * public @interface JoinTable {
031: * String name() default "";
032: * String catalog() default "";
033: * String schema() default "";
034: * JoinColumn[] joinColumns() default {};
035: * JoinColumn[] inverseJoinColumns() default {};
036: * UniqueConstraint[] uniqueConstraints() default {};
037: * }
038: *
039: *
040: *
041: * <p>Java class for join-table complex type.
042: *
043: * <p>The following schema fragment specifies the expected content contained within this class.
044: *
045: * <pre>
046: * <complexType name="join-table">
047: * <complexContent>
048: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
049: * <sequence>
050: * <element name="join-column" type="{http://java.sun.com/xml/ns/persistence/orm}join-column" maxOccurs="unbounded" minOccurs="0"/>
051: * <element name="inverse-join-column" type="{http://java.sun.com/xml/ns/persistence/orm}join-column" maxOccurs="unbounded" minOccurs="0"/>
052: * <element name="unique-constraint" type="{http://java.sun.com/xml/ns/persistence/orm}unique-constraint" maxOccurs="unbounded" minOccurs="0"/>
053: * </sequence>
054: * <attribute name="catalog" type="{http://www.w3.org/2001/XMLSchema}string" />
055: * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
056: * <attribute name="schema" type="{http://www.w3.org/2001/XMLSchema}string" />
057: * </restriction>
058: * </complexContent>
059: * </complexType>
060: * </pre>
061: *
062: *
063: */
064: @XmlAccessorType(XmlAccessType.FIELD)
065: @XmlType(name="join-table",propOrder={"joinColumn","inverseJoinColumn","uniqueConstraint"})
066: public class JoinTable {
067:
068: @XmlElement(name="join-column")
069: protected List<JoinColumn> joinColumn;
070: @XmlElement(name="inverse-join-column")
071: protected List<JoinColumn> inverseJoinColumn;
072: @XmlElement(name="unique-constraint")
073: protected List<UniqueConstraint> uniqueConstraint;
074: @XmlAttribute
075: protected String catalog;
076: @XmlAttribute
077: protected String name;
078: @XmlAttribute
079: protected String schema;
080:
081: /**
082: * Gets the value of the joinColumn property.
083: *
084: * <p>
085: * This accessor method returns a reference to the live list,
086: * not a snapshot. Therefore any modification you make to the
087: * returned list will be present inside the JAXB object.
088: * This is why there is not a <CODE>set</CODE> method for the joinColumn property.
089: *
090: * <p>
091: * For example, to add a new item, do as follows:
092: * <pre>
093: * getJoinColumn().add(newItem);
094: * </pre>
095: *
096: *
097: * <p>
098: * Objects of the following type(s) are allowed in the list
099: * {@link JoinColumn }
100: *
101: *
102: */
103: public List<JoinColumn> getJoinColumn() {
104: if (joinColumn == null) {
105: joinColumn = new ArrayList<JoinColumn>();
106: }
107: return this .joinColumn;
108: }
109:
110: /**
111: * Gets the value of the inverseJoinColumn property.
112: *
113: * <p>
114: * This accessor method returns a reference to the live list,
115: * not a snapshot. Therefore any modification you make to the
116: * returned list will be present inside the JAXB object.
117: * This is why there is not a <CODE>set</CODE> method for the inverseJoinColumn property.
118: *
119: * <p>
120: * For example, to add a new item, do as follows:
121: * <pre>
122: * getInverseJoinColumn().add(newItem);
123: * </pre>
124: *
125: *
126: * <p>
127: * Objects of the following type(s) are allowed in the list
128: * {@link JoinColumn }
129: *
130: *
131: */
132: public List<JoinColumn> getInverseJoinColumn() {
133: if (inverseJoinColumn == null) {
134: inverseJoinColumn = new ArrayList<JoinColumn>();
135: }
136: return this .inverseJoinColumn;
137: }
138:
139: /**
140: * Gets the value of the uniqueConstraint property.
141: *
142: * <p>
143: * This accessor method returns a reference to the live list,
144: * not a snapshot. Therefore any modification you make to the
145: * returned list will be present inside the JAXB object.
146: * This is why there is not a <CODE>set</CODE> method for the uniqueConstraint property.
147: *
148: * <p>
149: * For example, to add a new item, do as follows:
150: * <pre>
151: * getUniqueConstraint().add(newItem);
152: * </pre>
153: *
154: *
155: * <p>
156: * Objects of the following type(s) are allowed in the list
157: * {@link UniqueConstraint }
158: *
159: *
160: */
161: public List<UniqueConstraint> getUniqueConstraint() {
162: if (uniqueConstraint == null) {
163: uniqueConstraint = new ArrayList<UniqueConstraint>();
164: }
165: return this .uniqueConstraint;
166: }
167:
168: /**
169: * Gets the value of the catalog property.
170: *
171: * @return
172: * possible object is
173: * {@link String }
174: *
175: */
176: public String getCatalog() {
177: return catalog;
178: }
179:
180: /**
181: * Sets the value of the catalog property.
182: *
183: * @param value
184: * allowed object is
185: * {@link String }
186: *
187: */
188: public void setCatalog(String value) {
189: this .catalog = value;
190: }
191:
192: /**
193: * Gets the value of the name property.
194: *
195: * @return
196: * possible object is
197: * {@link String }
198: *
199: */
200: public String getName() {
201: return name;
202: }
203:
204: /**
205: * Sets the value of the name property.
206: *
207: * @param value
208: * allowed object is
209: * {@link String }
210: *
211: */
212: public void setName(String value) {
213: this .name = value;
214: }
215:
216: /**
217: * Gets the value of the schema property.
218: *
219: * @return
220: * possible object is
221: * {@link String }
222: *
223: */
224: public String getSchema() {
225: return schema;
226: }
227:
228: /**
229: * Sets the value of the schema property.
230: *
231: * @param value
232: * allowed object is
233: * {@link String }
234: *
235: */
236: public void setSchema(String value) {
237: this.schema = value;
238: }
239:
240: }
|