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