/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.openejb.jee.was.v6.ejb; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlIDREF; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.namespace.QName; import org.apache.openejb.jee.was.v6.common.Description; import org.apache.openejb.jee.was.v6.xmi.Extension; /** * The query element is used to specify a finder or select query. It contains an * optional description of the query; the specification of the finder or select * method it is used by; a specification of the return type mapping, if any, if * the query is for a select method; and the EJB QL query string that defines * the query. Queries that are expressible in EJB QL must use the ejb-ql element * to specify the query. If a query is not expressible in EJB QL, the * description element should be used to describe the semantics of the query and * the ejb-ql element should be empty. * <p/> * <p/> * <p/> * Java class for Query complex type. * <p/> * <p/> * The following schema fragment specifies the expected content contained within * this class. * <p/> * <pre> * <complexType name="Query"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <choice> * <choice maxOccurs="unbounded" minOccurs="0"> * <element name="queryMethod" type="{ejb.xmi}QueryMethod"/> * </choice> * <choice maxOccurs="unbounded" minOccurs="0"> * <element name="descriptions" type="{common.xmi}Description"/> * </choice> * <choice maxOccurs="unbounded" minOccurs="0"> * <element ref="{http://www.omg.org/XMI}Extension"/> * </choice> * </choice> * <attGroup ref="{http://www.omg.org/XMI}ObjectAttribs"/> * <attribute name="description" type="{http://www.w3.org/2001/XMLSchema}string" /> * <attribute name="ejbQL" type="{http://www.w3.org/2001/XMLSchema}string" /> * <attribute name="returnTypeMapping" type="{ejb.xmi}ReturnTypeMapping" /> * <attribute ref="{http://www.omg.org/XMI}id"/> * </restriction> * </complexContent> * </complexType> * </pre> */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Query", propOrder = {"queryMethods", "descriptions", "extensions"}) public class Query { @XmlElement(name = "queryMethod") protected List<QueryMethod> queryMethods; protected List<Description> descriptions; @XmlElement(name = "Extension", namespace = "http://www.omg.org/XMI") protected List<Extension> extensions; @XmlAttribute protected String description; @XmlAttribute protected String ejbQL; @XmlAttribute protected ReturnTypeMappingEnum returnTypeMapping; @XmlAttribute(namespace = "http://www.omg.org/XMI") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID protected String id; @XmlAttribute(namespace = "http://www.omg.org/XMI") protected QName type; @XmlAttribute(namespace = "http://www.omg.org/XMI") protected String version; @XmlAttribute protected String href; @XmlAttribute(namespace = "http://www.omg.org/XMI") @XmlIDREF protected Object idref; @XmlAttribute(namespace = "http://www.omg.org/XMI") protected String label; @XmlAttribute(namespace = "http://www.omg.org/XMI") protected String uuid; /** * Gets the value of the queryMethods property. * <p/> * <p/> * This accessor method returns a reference to the live list, not a * snapshot. Therefore any modification you make to the returned list will * be present inside the JAXB object. This is why there is not a * <CODE>set</CODE> method for the queryMethods property. * <p/> * <p/> * For example, to add a new item, do as follows: * <p/> * <pre> * getQueryMethods().add(newItem); * </pre> * <p/> * <p/> * <p/> * Objects of the following type(s) are allowed in the list * {@link QueryMethod } */ public List<QueryMethod> getQueryMethods() { if (queryMethods == null) { queryMethods = new ArrayList<QueryMethod>(); } return this.queryMethods; } /** * Gets the value of the descriptions property. * <p/> * <p/> * This accessor method returns a reference to the live list, not a * snapshot. Therefore any modification you make to the returned list will * be present inside the JAXB object. This is why there is not a * <CODE>set</CODE> method for the descriptions property. * <p/> * <p/> * For example, to add a new item, do as follows: * <p/> * <pre> * getDescriptions().add(newItem); * </pre> * <p/> * <p/> * <p/> * Objects of the following type(s) are allowed in the list * {@link Description } */ public List<Description> getDescriptions() { if (descriptions == null) { descriptions = new ArrayList<Description>(); } return this.descriptions; } /** * Gets the value of the extensions property. * <p/> * <p/> * This accessor method returns a reference to the live list, not a * snapshot. Therefore any modification you make to the returned list will * be present inside the JAXB object. This is why there is not a * <CODE>set</CODE> method for the extensions property. * <p/> * <p/> * For example, to add a new item, do as follows: * <p/> * <pre> * getExtensions().add(newItem); * </pre> * <p/> * <p/> * <p/> * Objects of the following type(s) are allowed in the list * {@link Extension } */ public List<Extension> getExtensions() { if (extensions == null) { extensions = new ArrayList<Extension>(); } return this.extensions; } /** * Gets the value of the description property. * * @return possible object is {@link String } */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value allowed object is {@link String } */ public void setDescription(final String value) { this.description = value; } /** * Gets the value of the ejbQL property. * * @return possible object is {@link String } */ public String getEjbQL() { return ejbQL; } /** * Sets the value of the ejbQL property. * * @param value allowed object is {@link String } */ public void setEjbQL(final String value) { this.ejbQL = value; } /** * Gets the value of the returnTypeMapping property. * * @return possible object is {@link ReturnTypeMappingEnum } */ public ReturnTypeMappingEnum getReturnTypeMapping() { return returnTypeMapping; } /** * Sets the value of the returnTypeMapping property. * * @param value allowed object is {@link ReturnTypeMappingEnum } */ public void setReturnTypeMapping(final ReturnTypeMappingEnum value) { this.returnTypeMapping = value; } /** * Gets the value of the id property. * * @return possible object is {@link String } */ public String getId() { return id; } /** * Sets the value of the id property. * * @param value allowed object is {@link String } */ public void setId(final String value) { this.id = value; } /** * Gets the value of the type property. * * @return possible object is {@link QName } */ public QName getType() { return type; } /** * Sets the value of the type property. * * @param value allowed object is {@link QName } */ public void setType(final QName value) { this.type = value; } /** * Gets the value of the version property. * * @return possible object is {@link String } */ public String getVersion() { if (version == null) { return "2.0"; } else { return version; } } /** * Sets the value of the version property. * * @param value allowed object is {@link String } */ public void setVersion(final String value) { this.version = value; } /** * Gets the value of the href property. * * @return possible object is {@link String } */ public String getHref() { return href; } /** * Sets the value of the href property. * * @param value allowed object is {@link String } */ public void setHref(final String value) { this.href = value; } /** * Gets the value of the idref property. * * @return possible object is {@link Object } */ public Object getIdref() { return idref; } /** * Sets the value of the idref property. * * @param value allowed object is {@link Object } */ public void setIdref(final Object value) { this.idref = value; } /** * Gets the value of the label property. * * @return possible object is {@link String } */ public String getLabel() { return label; } /** * Sets the value of the label property. * * @param value allowed object is {@link String } */ public void setLabel(final String value) { this.label = value; } /** * Gets the value of the uuid property. * * @return possible object is {@link String } */ public String getUuid() { return uuid; } /** * Sets the value of the uuid property. * * @param value allowed object is {@link String } */ public void setUuid(final String value) { this.uuid = value; } }