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 javax.xml.bind.annotation.XmlAccessType;
019: import javax.xml.bind.annotation.XmlAccessorType;
020: import javax.xml.bind.annotation.XmlAttribute;
021: import javax.xml.bind.annotation.XmlElement;
022: import javax.xml.bind.annotation.XmlType;
023:
024: /**
025: *
026: *
027: * @Target({METHOD, FIELD}) @Retention(RUNTIME)
028: * public @interface Id {}
029: *
030: *
031: *
032: * <p>Java class for id complex type.
033: *
034: * <p>The following schema fragment specifies the expected content contained within this class.
035: *
036: * <pre>
037: * <complexType name="id">
038: * <complexContent>
039: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
040: * <sequence>
041: * <element name="column" type="{http://java.sun.com/xml/ns/persistence/orm}column" minOccurs="0"/>
042: * <element name="generated-value" type="{http://java.sun.com/xml/ns/persistence/orm}generated-value" minOccurs="0"/>
043: * <element name="temporal" type="{http://java.sun.com/xml/ns/persistence/orm}temporal" minOccurs="0"/>
044: * <element name="table-generator" type="{http://java.sun.com/xml/ns/persistence/orm}table-generator" minOccurs="0"/>
045: * <element name="sequence-generator" type="{http://java.sun.com/xml/ns/persistence/orm}sequence-generator" minOccurs="0"/>
046: * </sequence>
047: * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
048: * </restriction>
049: * </complexContent>
050: * </complexType>
051: * </pre>
052: *
053: *
054: */
055: @XmlAccessorType(XmlAccessType.FIELD)
056: @XmlType(name="id",propOrder={"column","generatedValue","temporal","tableGenerator","sequenceGenerator"})
057: public class Id implements Field {
058:
059: protected Column column;
060: @XmlElement(name="generated-value")
061: protected GeneratedValue generatedValue;
062: protected TemporalType temporal;
063: @XmlElement(name="table-generator")
064: protected TableGenerator tableGenerator;
065: @XmlElement(name="sequence-generator")
066: protected SequenceGenerator sequenceGenerator;
067: @XmlAttribute(required=true)
068: protected String name;
069:
070: public Id() {
071: }
072:
073: public Id(String name) {
074: this .name = name;
075: }
076:
077: public Id(String name, String columnName) {
078: this .name = name;
079: this .column = new Column(columnName);
080: }
081:
082: /**
083: * Gets the value of the column property.
084: *
085: * @return
086: * possible object is
087: * {@link Column }
088: *
089: */
090: public Column getColumn() {
091: return column;
092: }
093:
094: /**
095: * Sets the value of the column property.
096: *
097: * @param value
098: * allowed object is
099: * {@link Column }
100: *
101: */
102: public void setColumn(Column value) {
103: this .column = value;
104: }
105:
106: /**
107: * Gets the value of the generatedValue property.
108: *
109: * @return
110: * possible object is
111: * {@link GeneratedValue }
112: *
113: */
114: public GeneratedValue getGeneratedValue() {
115: return generatedValue;
116: }
117:
118: /**
119: * Sets the value of the generatedValue property.
120: *
121: * @param value
122: * allowed object is
123: * {@link GeneratedValue }
124: *
125: */
126: public void setGeneratedValue(GeneratedValue value) {
127: this .generatedValue = value;
128: }
129:
130: /**
131: * Gets the value of the temporal property.
132: *
133: * @return
134: * possible object is
135: * {@link TemporalType }
136: *
137: */
138: public TemporalType getTemporal() {
139: return temporal;
140: }
141:
142: /**
143: * Sets the value of the temporal property.
144: *
145: * @param value
146: * allowed object is
147: * {@link TemporalType }
148: *
149: */
150: public void setTemporal(TemporalType value) {
151: this .temporal = value;
152: }
153:
154: /**
155: * Gets the value of the tableGenerator property.
156: *
157: * @return
158: * possible object is
159: * {@link TableGenerator }
160: *
161: */
162: public TableGenerator getTableGenerator() {
163: return tableGenerator;
164: }
165:
166: /**
167: * Sets the value of the tableGenerator property.
168: *
169: * @param value
170: * allowed object is
171: * {@link TableGenerator }
172: *
173: */
174: public void setTableGenerator(TableGenerator value) {
175: this .tableGenerator = value;
176: }
177:
178: /**
179: * Gets the value of the sequenceGenerator property.
180: *
181: * @return
182: * possible object is
183: * {@link SequenceGenerator }
184: *
185: */
186: public SequenceGenerator getSequenceGenerator() {
187: return sequenceGenerator;
188: }
189:
190: /**
191: * Sets the value of the sequenceGenerator property.
192: *
193: * @param value
194: * allowed object is
195: * {@link SequenceGenerator }
196: *
197: */
198: public void setSequenceGenerator(SequenceGenerator value) {
199: this .sequenceGenerator = value;
200: }
201:
202: /**
203: * Gets the value of the name property.
204: *
205: * @return
206: * possible object is
207: * {@link String }
208: *
209: */
210: public String getName() {
211: return name;
212: }
213:
214: /**
215: * Sets the value of the name property.
216: *
217: * @param value
218: * allowed object is
219: * {@link String }
220: *
221: */
222: public void setName(String value) {
223: this.name = value;
224: }
225:
226: }
|