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 GeneratedValue {
028: * GenerationType strategy() default AUTO;
029: * String generator() default "";
030: * }
031: *
032: *
033: *
034: * <p>Java class for generated-value complex type.
035: *
036: * <p>The following schema fragment specifies the expected content contained within this class.
037: *
038: * <pre>
039: * <complexType name="generated-value">
040: * <complexContent>
041: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
042: * <attribute name="generator" type="{http://www.w3.org/2001/XMLSchema}string" />
043: * <attribute name="strategy" type="{http://java.sun.com/xml/ns/persistence/orm}generation-type" />
044: * </restriction>
045: * </complexContent>
046: * </complexType>
047: * </pre>
048: *
049: *
050: */
051: @XmlAccessorType(XmlAccessType.FIELD)
052: @XmlType(name="generated-value")
053: public class GeneratedValue {
054:
055: @XmlAttribute
056: protected String generator;
057: @XmlAttribute
058: protected GenerationType strategy;
059:
060: public GeneratedValue() {
061: }
062:
063: public GeneratedValue(GenerationType strategy) {
064: this .strategy = strategy;
065: }
066:
067: public GeneratedValue(GenerationType strategy, String generator) {
068: this .strategy = strategy;
069: this .generator = generator;
070: }
071:
072: /**
073: * Gets the value of the generator property.
074: *
075: * @return
076: * possible object is
077: * {@link String }
078: *
079: */
080: public String getGenerator() {
081: return generator;
082: }
083:
084: /**
085: * Sets the value of the generator property.
086: *
087: * @param value
088: * allowed object is
089: * {@link String }
090: *
091: */
092: public void setGenerator(String value) {
093: this .generator = value;
094: }
095:
096: /**
097: * Gets the value of the strategy property.
098: *
099: * @return
100: * possible object is
101: * {@link GenerationType }
102: *
103: */
104: public GenerationType getStrategy() {
105: return strategy;
106: }
107:
108: /**
109: * Sets the value of the strategy property.
110: *
111: * @param value
112: * allowed object is
113: * {@link GenerationType }
114: *
115: */
116: public void setStrategy(GenerationType value) {
117: this.strategy = value;
118: }
119:
120: }
|