001: /**
002: *
003: * Licensed to the Apache Software Foundation (ASF) under one or more
004: * contributor license agreements. See the NOTICE file distributed with
005: * this work for additional information regarding copyright ownership.
006: * The ASF licenses this file to You under the Apache License, Version 2.0
007: * (the "License"); you may not use this file except in compliance with
008: * the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */package org.apache.openejb.jee;
018:
019: import javax.xml.bind.annotation.XmlAccessType;
020: import javax.xml.bind.annotation.XmlAccessorType;
021: import javax.xml.bind.annotation.XmlAttribute;
022: import javax.xml.bind.annotation.XmlElement;
023: import javax.xml.bind.annotation.XmlID;
024: import javax.xml.bind.annotation.XmlType;
025: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
026: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
027:
028: /**
029: * The queryType defines a finder or select
030: * query. It contains
031: * - an optional description of the query
032: * - the specification of the finder or select
033: * method it is used by
034: * - an optional specification of the result type
035: * mapping, if the query is for a select method
036: * and entity objects are returned.
037: * - the EJB QL query string that defines the query.
038: * <p/>
039: * Queries that are expressible in EJB QL must use the ejb-ql
040: * element to specify the query. If a query is not expressible
041: * in EJB QL, the description element should be used to
042: * describe the semantics of the query and the ejb-ql element
043: * should be empty.
044: * <p/>
045: * The result-type-mapping is an optional element. It can only
046: * be present if the query-method specifies a select method
047: * that returns entity objects. The default value for the
048: * result-type-mapping element is "Local".
049: */
050: @XmlAccessorType(XmlAccessType.FIELD)
051: @XmlType(name="queryType",propOrder={"description","queryMethod","resultTypeMapping","ejbQl"})
052: public class Query {
053:
054: protected Text description;
055: @XmlElement(name="query-method",required=true)
056: protected QueryMethod queryMethod;
057: @XmlElement(name="result-type-mapping")
058: protected ResultTypeMapping resultTypeMapping;
059: @XmlElement(name="ejb-ql",required=true)
060: protected String ejbQl;
061: @XmlAttribute
062: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
063: @XmlID
064: protected String id;
065:
066: public Text getDescription() {
067: return description;
068: }
069:
070: public void setDescription(Text value) {
071: this .description = value;
072: }
073:
074: public QueryMethod getQueryMethod() {
075: return queryMethod;
076: }
077:
078: public void setQueryMethod(QueryMethod value) {
079: this .queryMethod = value;
080: }
081:
082: public ResultTypeMapping getResultTypeMapping() {
083: return resultTypeMapping;
084: }
085:
086: public void setResultTypeMapping(ResultTypeMapping value) {
087: this .resultTypeMapping = value;
088: }
089:
090: public String getEjbQl() {
091: return ejbQl;
092: }
093:
094: public void setEjbQl(String value) {
095: this .ejbQl = value;
096: }
097:
098: public String getId() {
099: return id;
100: }
101:
102: public void setId(String value) {
103: this.id = value;
104: }
105:
106: }
|