jboss-jpa_1_0.xsd 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ JBoss, Home of Professional Open Source.
  4. ~ Copyright 2012, Red Hat, Inc., and individual contributors
  5. ~ as indicated by the @author tags. See the copyright.txt file in the
  6. ~ distribution for a full listing of individual contributors.
  7. ~
  8. ~ This is free software; you can redistribute it and/or modify it
  9. ~ under the terms of the GNU Lesser General Public License as
  10. ~ published by the Free Software Foundation; either version 2.1 of
  11. ~ the License, or (at your option) any later version.
  12. ~
  13. ~ This software is distributed in the hope that it will be useful,
  14. ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. ~ Lesser General Public License for more details.
  17. ~
  18. ~ You should have received a copy of the GNU Lesser General Public
  19. ~ License along with this software; if not, write to the Free
  20. ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  22. -->
  23. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  24. targetNamespace="urn:jboss:jboss-jpa:1.0"
  25. xmlns="urn:jboss:jboss-jpa:1.0"
  26. elementFormDefault="unqualified"
  27. attributeFormDefault="unqualified"
  28. version="1.0">
  29. <!-- jboss-jpa may be in a jboss-all.xml deployment descriptor to choose between
  30. deep/shallow extended persistence inheritance.
  31. -->
  32. <!-- example of using shallow inheritance
  33. <jboss>
  34. <jboss-jpa xmlns="http://www.jboss.com/xml/ns/javaee">
  35. <extended-persistence inheritance="SHALLOW"/>
  36. </jboss-jpa>
  37. </jboss>
  38. -->
  39. <!-- example of using deep inheritance
  40. <jboss>
  41. <jboss-jpa xmlns="http://www.jboss.com/xml/ns/javaee">
  42. <extended-persistence inheritance="DEEP"/>
  43. </jboss-jpa>
  44. </jboss>
  45. -->
  46. <!-- Root element -->
  47. <xs:element name="jboss-jpa" type="jboss-jpa-type"/>
  48. <xs:complexType name="jboss-jpa-type">
  49. <xs:all>
  50. <xs:element name="extended-persistence" type="extended-persistence-type" minOccurs="0" maxOccurs="1"/>
  51. </xs:all>
  52. </xs:complexType>
  53. <xs:complexType name="extended-persistence-type">
  54. <xs:attribute name="inheritance" type="extended-persistence-inheritance-type" default="DEEP" use="optional">
  55. <xs:annotation>
  56. <xs:documentation>
  57. <![CDATA[[
  58. Controls how JPA extended persistence context (XPC) inheritance is performed.
  59. XPC inheritance only occurs between stateful session beans used within the same EJB3 thread.
  60. This might be a stateful bean that injects other stateful beans (directly or via JNDI lookup).
  61. With DEEP extended persistence inheritance, the extended persistence context is always shared at
  62. the top most stateful bean level. Even if the top level bean does not have an extended persistence
  63. context, sub-beans (siblings) will share the extended persistence context (requiring fewer copies of
  64. entities to be loaded).
  65. With SHALLOW extended persistence inheritance, the extended persistence context is only shared between
  66. a stateful bean and its parent bean. This means that sibling stateful beans with the same parent bean,
  67. will have isolated persistence contexts (assuming the parent bean doesn't have an extended persistence
  68. context).
  69. ]]>
  70. </xs:documentation>
  71. </xs:annotation>
  72. </xs:attribute>
  73. </xs:complexType>
  74. <xs:simpleType name="extended-persistence-inheritance-type">
  75. <xs:restriction base="xs:token">
  76. <xs:enumeration value="DEEP" />
  77. <xs:enumeration value="SHALLOW" />
  78. </xs:restriction>
  79. </xs:simpleType>
  80. </xs:schema>