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 package org.apache.geronimo.jee.persistence; 19 20 import java.io.Serializable; 21 import java.util.ArrayList; 22 import java.util.List; 23 24 import javax.xml.bind.annotation.XmlAccessType; 25 import javax.xml.bind.annotation.XmlAccessorType; 26 import javax.xml.bind.annotation.XmlAttribute; 27 import javax.xml.bind.annotation.XmlElement; 28 import javax.xml.bind.annotation.XmlRootElement; 29 import javax.xml.bind.annotation.XmlType; 30 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; 31 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; 32 33 34 /** 35 * <p>Java class for anonymous complex type. 36 * 37 * <p>The following schema fragment specifies the expected content contained within this class. 38 * 39 * <pre> 40 * <complexType> 41 * <complexContent> 42 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 43 * <sequence> 44 * <element name="persistence-unit" maxOccurs="unbounded" minOccurs="0"> 45 * <complexType> 46 * <complexContent> 47 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 48 * <sequence> 49 * <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> 50 * <element name="provider" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> 51 * <element name="jta-data-source" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> 52 * <element name="non-jta-data-source" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> 53 * <element name="mapping-file" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/> 54 * <element name="jar-file" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/> 55 * <element name="class" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/> 56 * <element name="exclude-unlisted-classes" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> 57 * <element name="properties" minOccurs="0"> 58 * <complexType> 59 * <complexContent> 60 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 61 * <sequence> 62 * <element name="property" maxOccurs="unbounded" minOccurs="0"> 63 * <complexType> 64 * <complexContent> 65 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 66 * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 67 * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 68 * </restriction> 69 * </complexContent> 70 * </complexType> 71 * </element> 72 * </sequence> 73 * </restriction> 74 * </complexContent> 75 * </complexType> 76 * </element> 77 * </sequence> 78 * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 79 * <attribute name="transaction-type" type="{http://java.sun.com/xml/ns/persistence}persistence-unit-transaction-type" /> 80 * </restriction> 81 * </complexContent> 82 * </complexType> 83 * </element> 84 * </sequence> 85 * <attribute name="version" use="required" type="{http://java.sun.com/xml/ns/persistence}versionType" fixed="1.0" /> 86 * </restriction> 87 * </complexContent> 88 * </complexType> 89 * </pre> 90 * 91 * @version $Rev: 642503 $ $Date: 2008-03-29 12:35:01 +0800 (Sat, 29 Mar 2008) $ 92 */ 93 @XmlAccessorType(XmlAccessType.FIELD) 94 @XmlType(name = "", propOrder = { 95 "persistenceUnit" 96 }) 97 @XmlRootElement(name = "persistence") 98 public class Persistence implements Serializable 99 { 100 101 private final static long serialVersionUID = 12343L; 102 @XmlElement(name = "persistence-unit") 103 protected List<Persistence.PersistenceUnit> persistenceUnit; 104 @XmlAttribute(required = true) 105 @XmlJavaTypeAdapter(CollapsedStringAdapter.class) 106 protected String version; 107 108 /** 109 * Gets the value of the persistenceUnit property. 110 * 111 * <p> 112 * This accessor method returns a reference to the live list, 113 * not a snapshot. Therefore any modification you make to the 114 * returned list will be present inside the JAXB object. 115 * This is why there is not a <CODE>set</CODE> method for the persistenceUnit property. 116 * 117 * <p> 118 * For example, to add a new item, do as follows: 119 * <pre> 120 * getPersistenceUnit().add(newItem); 121 * </pre> 122 * 123 * 124 * <p> 125 * Objects of the following type(s) are allowed in the list 126 * {@link Persistence.PersistenceUnit } 127 * 128 * 129 */ 130 public List<Persistence.PersistenceUnit> getPersistenceUnit() { 131 if (persistenceUnit == null) { 132 persistenceUnit = new ArrayList<Persistence.PersistenceUnit>(); 133 } 134 return this.persistenceUnit; 135 } 136 137 /** 138 * Gets the value of the version property. 139 * 140 * @return 141 * possible object is 142 * {@link String } 143 * 144 */ 145 public String getVersion() { 146 if (version == null) { 147 return "1.0"; 148 } else { 149 return version; 150 } 151 } 152 153 /** 154 * Sets the value of the version property. 155 * 156 * @param value 157 * allowed object is 158 * {@link String } 159 * 160 */ 161 public void setVersion(String value) { 162 this.version = value; 163 } 164 165 166 /** 167 * 168 * 169 * Configuration of a persistence unit. 170 * 171 * 172 * 173 * <p>Java class for anonymous complex type. 174 * 175 * <p>The following schema fragment specifies the expected content contained within this class. 176 * 177 * <pre> 178 * <complexType> 179 * <complexContent> 180 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 181 * <sequence> 182 * <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> 183 * <element name="provider" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> 184 * <element name="jta-data-source" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> 185 * <element name="non-jta-data-source" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> 186 * <element name="mapping-file" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/> 187 * <element name="jar-file" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/> 188 * <element name="class" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/> 189 * <element name="exclude-unlisted-classes" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> 190 * <element name="properties" minOccurs="0"> 191 * <complexType> 192 * <complexContent> 193 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 194 * <sequence> 195 * <element name="property" maxOccurs="unbounded" minOccurs="0"> 196 * <complexType> 197 * <complexContent> 198 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 199 * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 200 * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 201 * </restriction> 202 * </complexContent> 203 * </complexType> 204 * </element> 205 * </sequence> 206 * </restriction> 207 * </complexContent> 208 * </complexType> 209 * </element> 210 * </sequence> 211 * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 212 * <attribute name="transaction-type" type="{http://java.sun.com/xml/ns/persistence}persistence-unit-transaction-type" /> 213 * </restriction> 214 * </complexContent> 215 * </complexType> 216 * </pre> 217 * 218 * 219 */ 220 @XmlAccessorType(XmlAccessType.FIELD) 221 @XmlType(name = "", propOrder = { 222 "description", 223 "provider", 224 "jtaDataSource", 225 "nonJtaDataSource", 226 "mappingFile", 227 "jarFile", 228 "clazz", 229 "excludeUnlistedClasses", 230 "properties" 231 }) 232 public static class PersistenceUnit 233 implements Serializable 234 { 235 236 private final static long serialVersionUID = 12343L; 237 protected String description; 238 protected String provider; 239 @XmlElement(name = "jta-data-source") 240 protected String jtaDataSource; 241 @XmlElement(name = "non-jta-data-source") 242 protected String nonJtaDataSource; 243 @XmlElement(name = "mapping-file") 244 protected List<String> mappingFile; 245 @XmlElement(name = "jar-file") 246 protected List<String> jarFile; 247 @XmlElement(name = "class") 248 protected List<String> clazz; 249 @XmlElement(name = "exclude-unlisted-classes", defaultValue = "false") 250 protected Boolean excludeUnlistedClasses; 251 protected Persistence.PersistenceUnit.Properties properties; 252 @XmlAttribute(required = true) 253 protected String name; 254 @XmlAttribute(name = "transaction-type") 255 protected PersistenceUnitTransaction transactionType; 256 257 /** 258 * Gets the value of the description property. 259 * 260 * @return 261 * possible object is 262 * {@link String } 263 * 264 */ 265 public String getDescription() { 266 return description; 267 } 268 269 /** 270 * Sets the value of the description property. 271 * 272 * @param value 273 * allowed object is 274 * {@link String } 275 * 276 */ 277 public void setDescription(String value) { 278 this.description = value; 279 } 280 281 /** 282 * Gets the value of the provider property. 283 * 284 * @return 285 * possible object is 286 * {@link String } 287 * 288 */ 289 public String getProvider() { 290 return provider; 291 } 292 293 /** 294 * Sets the value of the provider property. 295 * 296 * @param value 297 * allowed object is 298 * {@link String } 299 * 300 */ 301 public void setProvider(String value) { 302 this.provider = value; 303 } 304 305 /** 306 * Gets the value of the jtaDataSource property. 307 * 308 * @return 309 * possible object is 310 * {@link String } 311 * 312 */ 313 public String getJtaDataSource() { 314 return jtaDataSource; 315 } 316 317 /** 318 * Sets the value of the jtaDataSource property. 319 * 320 * @param value 321 * allowed object is 322 * {@link String } 323 * 324 */ 325 public void setJtaDataSource(String value) { 326 this.jtaDataSource = value; 327 } 328 329 /** 330 * Gets the value of the nonJtaDataSource property. 331 * 332 * @return 333 * possible object is 334 * {@link String } 335 * 336 */ 337 public String getNonJtaDataSource() { 338 return nonJtaDataSource; 339 } 340 341 /** 342 * Sets the value of the nonJtaDataSource property. 343 * 344 * @param value 345 * allowed object is 346 * {@link String } 347 * 348 */ 349 public void setNonJtaDataSource(String value) { 350 this.nonJtaDataSource = value; 351 } 352 353 /** 354 * Gets the value of the mappingFile property. 355 * 356 * <p> 357 * This accessor method returns a reference to the live list, 358 * not a snapshot. Therefore any modification you make to the 359 * returned list will be present inside the JAXB object. 360 * This is why there is not a <CODE>set</CODE> method for the mappingFile property. 361 * 362 * <p> 363 * For example, to add a new item, do as follows: 364 * <pre> 365 * getMappingFile().add(newItem); 366 * </pre> 367 * 368 * 369 * <p> 370 * Objects of the following type(s) are allowed in the list 371 * {@link String } 372 * 373 * 374 */ 375 public List<String> getMappingFile() { 376 if (mappingFile == null) { 377 mappingFile = new ArrayList<String>(); 378 } 379 return this.mappingFile; 380 } 381 382 /** 383 * Gets the value of the jarFile property. 384 * 385 * <p> 386 * This accessor method returns a reference to the live list, 387 * not a snapshot. Therefore any modification you make to the 388 * returned list will be present inside the JAXB object. 389 * This is why there is not a <CODE>set</CODE> method for the jarFile property. 390 * 391 * <p> 392 * For example, to add a new item, do as follows: 393 * <pre> 394 * getJarFile().add(newItem); 395 * </pre> 396 * 397 * 398 * <p> 399 * Objects of the following type(s) are allowed in the list 400 * {@link String } 401 * 402 * 403 */ 404 public List<String> getJarFile() { 405 if (jarFile == null) { 406 jarFile = new ArrayList<String>(); 407 } 408 return this.jarFile; 409 } 410 411 /** 412 * Gets the value of the clazz property. 413 * 414 * <p> 415 * This accessor method returns a reference to the live list, 416 * not a snapshot. Therefore any modification you make to the 417 * returned list will be present inside the JAXB object. 418 * This is why there is not a <CODE>set</CODE> method for the clazz property. 419 * 420 * <p> 421 * For example, to add a new item, do as follows: 422 * <pre> 423 * getClazz().add(newItem); 424 * </pre> 425 * 426 * 427 * <p> 428 * Objects of the following type(s) are allowed in the list 429 * {@link String } 430 * 431 * 432 */ 433 public List<String> getClazz() { 434 if (clazz == null) { 435 clazz = new ArrayList<String>(); 436 } 437 return this.clazz; 438 } 439 440 /** 441 * Gets the value of the excludeUnlistedClasses property. 442 * 443 * @return 444 * possible object is 445 * {@link Boolean } 446 * 447 */ 448 public Boolean isExcludeUnlistedClasses() { 449 return excludeUnlistedClasses; 450 } 451 452 /** 453 * Sets the value of the excludeUnlistedClasses property. 454 * 455 * @param value 456 * allowed object is 457 * {@link Boolean } 458 * 459 */ 460 public void setExcludeUnlistedClasses(Boolean value) { 461 this.excludeUnlistedClasses = value; 462 } 463 464 /** 465 * Gets the value of the properties property. 466 * 467 * @return 468 * possible object is 469 * {@link Persistence.PersistenceUnit.Properties } 470 * 471 */ 472 public Persistence.PersistenceUnit.Properties getProperties() { 473 return properties; 474 } 475 476 /** 477 * Sets the value of the properties property. 478 * 479 * @param value 480 * allowed object is 481 * {@link Persistence.PersistenceUnit.Properties } 482 * 483 */ 484 public void setProperties(Persistence.PersistenceUnit.Properties value) { 485 this.properties = value; 486 } 487 488 /** 489 * Gets the value of the name property. 490 * 491 * @return 492 * possible object is 493 * {@link String } 494 * 495 */ 496 public String getName() { 497 return name; 498 } 499 500 /** 501 * Sets the value of the name property. 502 * 503 * @param value 504 * allowed object is 505 * {@link String } 506 * 507 */ 508 public void setName(String value) { 509 this.name = value; 510 } 511 512 /** 513 * Gets the value of the transactionType property. 514 * 515 * @return 516 * possible object is 517 * {@link PersistenceUnitTransaction } 518 * 519 */ 520 public PersistenceUnitTransaction getTransactionType() { 521 return transactionType; 522 } 523 524 /** 525 * Sets the value of the transactionType property. 526 * 527 * @param value 528 * allowed object is 529 * {@link PersistenceUnitTransaction } 530 * 531 */ 532 public void setTransactionType(PersistenceUnitTransaction value) { 533 this.transactionType = value; 534 } 535 536 537 /** 538 * <p>Java class for anonymous complex type. 539 * 540 * <p>The following schema fragment specifies the expected content contained within this class. 541 * 542 * <pre> 543 * <complexType> 544 * <complexContent> 545 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 546 * <sequence> 547 * <element name="property" maxOccurs="unbounded" minOccurs="0"> 548 * <complexType> 549 * <complexContent> 550 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 551 * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 552 * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 553 * </restriction> 554 * </complexContent> 555 * </complexType> 556 * </element> 557 * </sequence> 558 * </restriction> 559 * </complexContent> 560 * </complexType> 561 * </pre> 562 * 563 * 564 */ 565 @XmlAccessorType(XmlAccessType.FIELD) 566 @XmlType(name = "", propOrder = { 567 "property" 568 }) 569 public static class Properties 570 implements Serializable 571 { 572 573 private final static long serialVersionUID = 12343L; 574 protected List<Persistence.PersistenceUnit.Properties.Property> property; 575 576 /** 577 * Gets the value of the property property. 578 * 579 * <p> 580 * This accessor method returns a reference to the live list, 581 * not a snapshot. Therefore any modification you make to the 582 * returned list will be present inside the JAXB object. 583 * This is why there is not a <CODE>set</CODE> method for the property property. 584 * 585 * <p> 586 * For example, to add a new item, do as follows: 587 * <pre> 588 * getProperty().add(newItem); 589 * </pre> 590 * 591 * 592 * <p> 593 * Objects of the following type(s) are allowed in the list 594 * {@link Persistence.PersistenceUnit.Properties.Property } 595 * 596 * 597 */ 598 public List<Persistence.PersistenceUnit.Properties.Property> getProperty() { 599 if (property == null) { 600 property = new ArrayList<Persistence.PersistenceUnit.Properties.Property>(); 601 } 602 return this.property; 603 } 604 605 606 /** 607 * <p>Java class for anonymous complex type. 608 * 609 * <p>The following schema fragment specifies the expected content contained within this class. 610 * 611 * <pre> 612 * <complexType> 613 * <complexContent> 614 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 615 * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 616 * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 617 * </restriction> 618 * </complexContent> 619 * </complexType> 620 * </pre> 621 * 622 * 623 */ 624 @XmlAccessorType(XmlAccessType.FIELD) 625 @XmlType(name = "") 626 public static class Property 627 implements Serializable 628 { 629 630 private final static long serialVersionUID = 12343L; 631 @XmlAttribute(required = true) 632 protected String name; 633 @XmlAttribute(required = true) 634 protected String value; 635 636 /** 637 * Gets the value of the name property. 638 * 639 * @return 640 * possible object is 641 * {@link String } 642 * 643 */ 644 public String getName() { 645 return name; 646 } 647 648 /** 649 * Sets the value of the name property. 650 * 651 * @param value 652 * allowed object is 653 * {@link String } 654 * 655 */ 656 public void setName(String value) { 657 this.name = value; 658 } 659 660 /** 661 * Gets the value of the value property. 662 * 663 * @return 664 * possible object is 665 * {@link String } 666 * 667 */ 668 public String getValue() { 669 return value; 670 } 671 672 /** 673 * Sets the value of the value property. 674 * 675 * @param value 676 * allowed object is 677 * {@link String } 678 * 679 */ 680 public void setValue(String value) { 681 this.value = value; 682 } 683 684 } 685 686 } 687 688 } 689 690 }