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