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}) @Retention(RUNTIME)
030: * public @interface SqlResultSetMapping {
031: * String name();
032: * EntityResult[] entities() default {};
033: * ColumnResult[] columns() default {};
034: * }
035: *
036: *
037: *
038: * <p>Java class for sql-result-set-mapping complex type.
039: *
040: * <p>The following schema fragment specifies the expected content contained within this class.
041: *
042: * <pre>
043: * <complexType name="sql-result-set-mapping">
044: * <complexContent>
045: * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
046: * <sequence>
047: * <element name="entity-result" type="{http://java.sun.com/xml/ns/persistence/orm}entity-result" maxOccurs="unbounded" minOccurs="0"/>
048: * <element name="column-result" type="{http://java.sun.com/xml/ns/persistence/orm}column-result" maxOccurs="unbounded" minOccurs="0"/>
049: * </sequence>
050: * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
051: * </restriction>
052: * </complexContent>
053: * </complexType>
054: * </pre>
055: *
056: *
057: */
058: @XmlAccessorType(XmlAccessType.FIELD)
059: @XmlType(name="sql-result-set-mapping",propOrder={"entityResult","columnResult"})
060: public class SqlResultSetMapping {
061:
062: @XmlElement(name="entity-result")
063: protected List<EntityResult> entityResult;
064: @XmlElement(name="column-result")
065: protected List<ColumnResult> columnResult;
066: @XmlAttribute(required=true)
067: protected String name;
068:
069: /**
070: * Gets the value of the entityResult property.
071: *
072: * <p>
073: * This accessor method returns a reference to the live list,
074: * not a snapshot. Therefore any modification you make to the
075: * returned list will be present inside the JAXB object.
076: * This is why there is not a <CODE>set</CODE> method for the entityResult property.
077: *
078: * <p>
079: * For example, to add a new item, do as follows:
080: * <pre>
081: * getEntityResult().add(newItem);
082: * </pre>
083: *
084: *
085: * <p>
086: * Objects of the following type(s) are allowed in the list
087: * {@link EntityResult }
088: *
089: *
090: */
091: public List<EntityResult> getEntityResult() {
092: if (entityResult == null) {
093: entityResult = new ArrayList<EntityResult>();
094: }
095: return this .entityResult;
096: }
097:
098: /**
099: * Gets the value of the columnResult property.
100: *
101: * <p>
102: * This accessor method returns a reference to the live list,
103: * not a snapshot. Therefore any modification you make to the
104: * returned list will be present inside the JAXB object.
105: * This is why there is not a <CODE>set</CODE> method for the columnResult property.
106: *
107: * <p>
108: * For example, to add a new item, do as follows:
109: * <pre>
110: * getColumnResult().add(newItem);
111: * </pre>
112: *
113: *
114: * <p>
115: * Objects of the following type(s) are allowed in the list
116: * {@link ColumnResult }
117: *
118: *
119: */
120: public List<ColumnResult> getColumnResult() {
121: if (columnResult == null) {
122: columnResult = new ArrayList<ColumnResult>();
123: }
124: return this .columnResult;
125: }
126:
127: /**
128: * Gets the value of the name property.
129: *
130: * @return
131: * possible object is
132: * {@link String }
133: *
134: */
135: public String getName() {
136: return name;
137: }
138:
139: /**
140: * Sets the value of the name property.
141: *
142: * @param value
143: * allowed object is
144: * {@link String }
145: *
146: */
147: public void setName(String value) {
148: this.name = value;
149: }
150:
151: }
|