Home » openejb-3.1.2-src » org.apache » openejb » jee » jpa » unit » [javadoc | source]

    1   /**
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    * Unless required by applicable law or agreed to in writing, software
   12    * distributed under the License is distributed on an "AS IS" BASIS,
   13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    * See the License for the specific language governing permissions and
   15    * limitations under the License.
   16    */
   17   //
   18   // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.1-b01-fcs 
   19   // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
   20   // Any modifications to this file will be lost upon recompilation of the source schema. 
   21   // Generated on: 2006.08.11 at 06:51:30 PM PDT 
   22   //
   23   
   24   
   25   package org.apache.openejb.jee.jpa.unit;
   26   
   27   import java.util.ArrayList;
   28   import java.util.List;
   29   import javax.xml.bind.annotation.XmlAccessType;
   30   import javax.xml.bind.annotation.XmlAccessorType;
   31   import javax.xml.bind.annotation.XmlAttribute;
   32   import javax.xml.bind.annotation.XmlElement;
   33   import javax.xml.bind.annotation.XmlRootElement;
   34   import javax.xml.bind.annotation.XmlType;
   35   import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
   36   import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
   37   
   38   
   39   /**
   40    * <p>Java class for anonymous complex type.
   41    * 
   42    * <p>The following schema fragment specifies the expected content contained within this class.
   43    * 
   44    * <pre>
   45    * &lt;complexType>
   46    *   &lt;complexContent>
   47    *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
   48    *       &lt;sequence>
   49    *         &lt;element name="persistence-unit" maxOccurs="unbounded" minOccurs="0">
   50    *           &lt;complexType>
   51    *             &lt;complexContent>
   52    *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
   53    *                 &lt;sequence>
   54    *                   &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
   55    *                   &lt;element name="provider" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
   56    *                   &lt;element name="jta-data-source" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
   57    *                   &lt;element name="non-jta-data-source" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
   58    *                   &lt;element name="mapping-file" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
   59    *                   &lt;element name="jar-file" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
   60    *                   &lt;element name="class" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
   61    *                   &lt;element name="exclude-unlisted-classes" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
   62    *                   &lt;element name="properties" minOccurs="0">
   63    *                     &lt;complexType>
   64    *                       &lt;complexContent>
   65    *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
   66    *                           &lt;sequence>
   67    *                             &lt;element name="property" maxOccurs="unbounded" minOccurs="0">
   68    *                               &lt;complexType>
   69    *                                 &lt;complexContent>
   70    *                                   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
   71    *                                     &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
   72    *                                     &lt;attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
   73    *                                   &lt;/restriction>
   74    *                                 &lt;/complexContent>
   75    *                               &lt;/complexType>
   76    *                             &lt;/element>
   77    *                           &lt;/sequence>
   78    *                         &lt;/restriction>
   79    *                       &lt;/complexContent>
   80    *                     &lt;/complexType>
   81    *                   &lt;/element>
   82    *                 &lt;/sequence>
   83    *                 &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
   84    *                 &lt;attribute name="transaction-type" type="{http://java.sun.com/xml/ns/persistence}persistence-unit-transaction-type" />
   85    *               &lt;/restriction>
   86    *             &lt;/complexContent>
   87    *           &lt;/complexType>
   88    *         &lt;/element>
   89    *       &lt;/sequence>
   90    *       &lt;attribute name="version" use="required" type="{http://java.sun.com/xml/ns/persistence}versionType" fixed="1.0" />
   91    *     &lt;/restriction>
   92    *   &lt;/complexContent>
   93    * &lt;/complexType>
   94    * </pre>
   95    * 
   96    * 
   97    */
   98   @XmlAccessorType(XmlAccessType.FIELD)
   99   @XmlType(name = "", propOrder = {
  100       "persistenceUnit"
  101   })
  102   @XmlRootElement(name = "persistence")
  103   public class Persistence {
  104   
  105       @XmlElement(name = "persistence-unit", required = true)
  106       protected List<PersistenceUnit> persistenceUnit;
  107       @XmlAttribute(required = true)
  108       @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
  109       protected String version = "1.0";
  110   
  111       public Persistence() {
  112       }
  113   
  114       public Persistence(PersistenceUnit... persistenceUnit) {
  115           for (PersistenceUnit unit : persistenceUnit) {
  116               getPersistenceUnit().add(unit);
  117           }
  118       }
  119   
  120       /**
  121        * Gets the value of the persistenceUnit property.
  122        * 
  123        * <p>
  124        * This accessor method returns a reference to the live list,
  125        * not a snapshot. Therefore any modification you make to the
  126        * returned list will be present inside the JAXB object.
  127        * This is why there is not a <CODE>set</CODE> method for the persistenceUnit property.
  128        * 
  129        * <p>
  130        * For example, to add a new item, do as follows:
  131        * <pre>
  132        *    getPersistenceUnit().add(newItem);
  133        * </pre>
  134        * 
  135        * 
  136        * <p>
  137        * Objects of the following type(s) are allowed in the list
  138        * {@link PersistenceUnit }
  139        * 
  140        * 
  141        */
  142       public List<PersistenceUnit> getPersistenceUnit() {
  143           if (persistenceUnit == null) {
  144               persistenceUnit = new ArrayList<PersistenceUnit>();
  145           }
  146           return this.persistenceUnit;
  147       }
  148   
  149       /**
  150        * Gets the value of the version property.
  151        * 
  152        * @return
  153        *     possible object is
  154        *     {@link String }
  155        *     
  156        */
  157       public String getVersion() {
  158           if (version == null) {
  159               return "1.0";
  160           } else {
  161               return version;
  162           }
  163       }
  164   
  165       /**
  166        * Sets the value of the version property.
  167        * 
  168        * @param value
  169        *     allowed object is
  170        *     {@link String }
  171        *     
  172        */
  173       public void setVersion(String value) {
  174           this.version = value;
  175       }
  176   
  177   
  178   }

Home » openejb-3.1.2-src » org.apache » openejb » jee » jpa » unit » [javadoc | source]