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({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
028: * public @interface AttributeOverride {
029: * String name();
030: * Column column();
031: * }
032: *
033: *
034: *
035: * <p>Java class for attribute-override complex type.
036: *
037: * <p>The following schema fragment specifies the expected content contained within this class.
038: *
039: * <pre>
040: * <complexType name="attribute-override">
041: * <complexContent>
042: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
043: * <sequence>
044: * <element name="column" type="{http://java.sun.com/xml/ns/persistence/orm}column"/>
045: * </sequence>
046: * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
047: * </restriction>
048: * </complexContent>
049: * </complexType>
050: * </pre>
051: *
052: *
053: */
054: @XmlAccessorType(XmlAccessType.FIELD)
055: @XmlType(name="attribute-override",propOrder={"column"})
056: public class AttributeOverride implements Field {
057:
058: @XmlElement(required=true)
059: protected Column column;
060: @XmlAttribute(required=true)
061: protected String name;
062:
063: public AttributeOverride() {
064: }
065:
066: public AttributeOverride(String name) {
067: // column is required for an attribute override so
068: // declare one using the default column name
069: this (name, name);
070: }
071:
072: public AttributeOverride(String name, String columnName) {
073: this .name = name;
074: this .column = new Column(columnName);
075: }
076:
077: /**
078: * Gets the value of the column property.
079: *
080: * @return
081: * possible object is
082: * {@link Column }
083: *
084: */
085: public Column getColumn() {
086: return column;
087: }
088:
089: /**
090: * Sets the value of the column property.
091: *
092: * @param value
093: * allowed object is
094: * {@link Column }
095: *
096: */
097: public void setColumn(Column value) {
098: this .column = value;
099: }
100:
101: /**
102: * Gets the value of the name property.
103: *
104: * @return
105: * possible object is
106: * {@link String }
107: *
108: */
109: public String getName() {
110: return name;
111: }
112:
113: /**
114: * Sets the value of the name property.
115: *
116: * @param value
117: * allowed object is
118: * {@link String }
119: *
120: */
121: public void setName(String value) {
122: this.name = value;
123: }
124:
125: }
|