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, METHOD, FIELD}) @Retention(RUNTIME)
030: * public @interface AssociationOverride {
031: * String name();
032: * JoinColumn[] joinColumns();
033: * }
034: *
035: *
036: *
037: * <p>Java class for association-override complex type.
038: *
039: * <p>The following schema fragment specifies the expected content contained within this class.
040: *
041: * <pre>
042: * <complexType name="association-override">
043: * <complexContent>
044: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
045: * <sequence>
046: * <element name="join-column" type="{http://java.sun.com/xml/ns/persistence/orm}join-column" maxOccurs="unbounded"/>
047: * </sequence>
048: * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
049: * </restriction>
050: * </complexContent>
051: * </complexType>
052: * </pre>
053: *
054: *
055: */
056: @XmlAccessorType(XmlAccessType.FIELD)
057: @XmlType(name="association-override",propOrder={"joinColumn"})
058: public class AssociationOverride {
059:
060: @XmlElement(name="join-column",required=true)
061: protected List<JoinColumn> joinColumn;
062: @XmlAttribute(required=true)
063: protected String name;
064:
065: /**
066: * Gets the value of the joinColumn property.
067: *
068: * <p>
069: * This accessor method returns a reference to the live list,
070: * not a snapshot. Therefore any modification you make to the
071: * returned list will be present inside the JAXB object.
072: * This is why there is not a <CODE>set</CODE> method for the joinColumn property.
073: *
074: * <p>
075: * For example, to add a new item, do as follows:
076: * <pre>
077: * getJoinColumn().add(newItem);
078: * </pre>
079: *
080: *
081: * <p>
082: * Objects of the following type(s) are allowed in the list
083: * {@link JoinColumn }
084: *
085: *
086: */
087: public List<JoinColumn> getJoinColumn() {
088: if (joinColumn == null) {
089: joinColumn = new ArrayList<JoinColumn>();
090: }
091: return this .joinColumn;
092: }
093:
094: /**
095: * Gets the value of the name property.
096: *
097: * @return
098: * possible object is
099: * {@link String }
100: *
101: */
102: public String getName() {
103: return name;
104: }
105:
106: /**
107: * Sets the value of the name property.
108: *
109: * @param value
110: * allowed object is
111: * {@link String }
112: *
113: */
114: public void setName(String value) {
115: this.name = value;
116: }
117:
118: }
|