doctrine-mapping.xsd 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  3. targetNamespace="http://doctrine-project.org/schemas/orm/doctrine-mapping"
  4. xmlns:orm="http://doctrine-project.org/schemas/orm/doctrine-mapping"
  5. elementFormDefault="qualified">
  6. <xs:annotation>
  7. <xs:documentation><![CDATA[
  8. This is the XML Schema for the object/relational
  9. mapping file used by the Doctrine ORM.
  10. ]]></xs:documentation>
  11. </xs:annotation>
  12. <xs:element name="doctrine-mapping">
  13. <xs:complexType>
  14. <xs:sequence>
  15. <xs:element name="mapped-superclass" type="orm:mapped-superclass" minOccurs="0" maxOccurs="unbounded" />
  16. <xs:element name="entity" type="orm:entity" minOccurs="0" maxOccurs="unbounded" />
  17. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  18. </xs:sequence>
  19. <xs:anyAttribute namespace="##other"/>
  20. </xs:complexType>
  21. </xs:element>
  22. <xs:complexType name="emptyType">
  23. <xs:sequence>
  24. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  25. </xs:sequence>
  26. <xs:anyAttribute namespace="##other"/>
  27. </xs:complexType>
  28. <xs:complexType name="cascade-type">
  29. <xs:sequence>
  30. <xs:element name="cascade-all" type="orm:emptyType" minOccurs="0"/>
  31. <xs:element name="cascade-persist" type="orm:emptyType" minOccurs="0"/>
  32. <xs:element name="cascade-merge" type="orm:emptyType" minOccurs="0"/>
  33. <xs:element name="cascade-remove" type="orm:emptyType" minOccurs="0"/>
  34. <xs:element name="cascade-refresh" type="orm:emptyType" minOccurs="0"/>
  35. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  36. </xs:sequence>
  37. <xs:anyAttribute namespace="##other"/>
  38. </xs:complexType>
  39. <xs:simpleType name="lifecycle-callback-type">
  40. <xs:restriction base="xs:token">
  41. <xs:enumeration value="prePersist"/>
  42. <xs:enumeration value="postPersist"/>
  43. <xs:enumeration value="preUpdate"/>
  44. <xs:enumeration value="postUpdate"/>
  45. <xs:enumeration value="preRemove"/>
  46. <xs:enumeration value="postRemove"/>
  47. <xs:enumeration value="postLoad"/>
  48. </xs:restriction>
  49. </xs:simpleType>
  50. <xs:complexType name="lifecycle-callback">
  51. <xs:sequence>
  52. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  53. </xs:sequence>
  54. <xs:attribute name="type" type="orm:lifecycle-callback-type" use="required" />
  55. <xs:attribute name="method" type="xs:NMTOKEN" use="required" />
  56. <xs:anyAttribute namespace="##other"/>
  57. </xs:complexType>
  58. <xs:complexType name="lifecycle-callbacks">
  59. <xs:sequence>
  60. <xs:element name="lifecycle-callback" type="orm:lifecycle-callback" minOccurs="1" maxOccurs="unbounded" />
  61. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  62. </xs:sequence>
  63. <xs:anyAttribute namespace="##other"/>
  64. </xs:complexType>
  65. <xs:complexType name="named-query">
  66. <xs:attribute name="name" type="xs:string" use="required" />
  67. <xs:attribute name="query" type="xs:string" use="required" />
  68. <xs:anyAttribute namespace="##other"/>
  69. </xs:complexType>
  70. <xs:complexType name="named-queries">
  71. <xs:sequence>
  72. <xs:element name="named-query" type="orm:named-query" minOccurs="1" maxOccurs="unbounded" />
  73. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  74. </xs:sequence>
  75. </xs:complexType>
  76. <xs:complexType name="entity">
  77. <xs:sequence>
  78. <xs:element name="indexes" type="orm:indexes" minOccurs="0"/>
  79. <xs:element name="unique-constraints" type="orm:unique-constraints" minOccurs="0"/>
  80. <xs:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
  81. <xs:element name="discriminator-map" type="orm:discriminator-map" minOccurs="0"/>
  82. <xs:element name="lifecycle-callbacks" type="orm:lifecycle-callbacks" minOccurs="0" maxOccurs="1" />
  83. <xs:element name="named-queries" type="orm:named-queries" minOccurs="0" maxOccurs="1" />
  84. <xs:element name="id" type="orm:id" minOccurs="0" maxOccurs="unbounded" />
  85. <xs:element name="field" type="orm:field" minOccurs="0" maxOccurs="unbounded"/>
  86. <xs:element name="one-to-one" type="orm:one-to-one" minOccurs="0" maxOccurs="unbounded"/>
  87. <xs:element name="one-to-many" type="orm:one-to-many" minOccurs="0" maxOccurs="unbounded" />
  88. <xs:element name="many-to-one" type="orm:many-to-one" minOccurs="0" maxOccurs="unbounded" />
  89. <xs:element name="many-to-many" type="orm:many-to-many" minOccurs="0" maxOccurs="unbounded" />
  90. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  91. </xs:sequence>
  92. <xs:attribute name="name" type="xs:string" use="required" />
  93. <xs:attribute name="table" type="xs:NMTOKEN" />
  94. <xs:attribute name="schema" type="xs:NMTOKEN" />
  95. <xs:attribute name="repository-class" type="xs:string"/>
  96. <xs:attribute name="inheritance-type" type="orm:inheritance-type"/>
  97. <xs:attribute name="change-tracking-policy" type="orm:change-tracking-policy" />
  98. <xs:attribute name="read-only" type="xs:boolean" default="false" />
  99. <xs:anyAttribute namespace="##other"/>
  100. </xs:complexType>
  101. <xs:complexType name="mapped-superclass" >
  102. <xs:complexContent>
  103. <xs:extension base="orm:entity">
  104. <xs:sequence>
  105. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  106. </xs:sequence>
  107. <xs:anyAttribute namespace="##other"/>
  108. </xs:extension>
  109. </xs:complexContent>
  110. </xs:complexType>
  111. <xs:simpleType name="change-tracking-policy">
  112. <xs:restriction base="xs:token">
  113. <xs:enumeration value="DEFERRED_IMPLICIT"/>
  114. <xs:enumeration value="DEFERRED_EXPLICIT"/>
  115. <xs:enumeration value="NOTIFY"/>
  116. </xs:restriction>
  117. </xs:simpleType>
  118. <xs:simpleType name="inheritance-type">
  119. <xs:restriction base="xs:token">
  120. <xs:enumeration value="SINGLE_TABLE"/>
  121. <xs:enumeration value="JOINED"/>
  122. <xs:enumeration value="TABLE_PER_CLASS"/>
  123. </xs:restriction>
  124. </xs:simpleType>
  125. <xs:simpleType name="generator-strategy">
  126. <xs:restriction base="xs:token">
  127. <xs:enumeration value="TABLE"/>
  128. <xs:enumeration value="SEQUENCE"/>
  129. <xs:enumeration value="IDENTITY"/>
  130. <xs:enumeration value="AUTO"/>
  131. </xs:restriction>
  132. </xs:simpleType>
  133. <xs:simpleType name="fk-action">
  134. <xs:restriction base="xs:token">
  135. <xs:enumeration value="CASCADE"/>
  136. <xs:enumeration value="RESTRICT"/>
  137. <xs:enumeration value="SET_NULL"/>
  138. </xs:restriction>
  139. </xs:simpleType>
  140. <xs:simpleType name="fetch-type">
  141. <xs:restriction base="xs:token">
  142. <xs:enumeration value="EAGER"/>
  143. <xs:enumeration value="LAZY"/>
  144. <xs:enumeration value="EXTRALAZY"/>
  145. </xs:restriction>
  146. </xs:simpleType>
  147. <xs:complexType name="field">
  148. <xs:sequence>
  149. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  150. </xs:sequence>
  151. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  152. <xs:attribute name="type" type="xs:NMTOKEN" default="string" />
  153. <xs:attribute name="column" type="xs:NMTOKEN" />
  154. <xs:attribute name="length" type="xs:NMTOKEN" />
  155. <xs:attribute name="unique" type="xs:boolean" default="false" />
  156. <xs:attribute name="nullable" type="xs:boolean" default="false" />
  157. <xs:attribute name="version" type="xs:boolean" />
  158. <xs:attribute name="column-definition" type="xs:string" />
  159. <xs:attribute name="precision" type="xs:integer" use="optional" />
  160. <xs:attribute name="scale" type="xs:integer" use="optional" />
  161. <xs:anyAttribute namespace="##other"/>
  162. </xs:complexType>
  163. <xs:complexType name="discriminator-column">
  164. <xs:sequence>
  165. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  166. </xs:sequence>
  167. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  168. <xs:attribute name="type" type="xs:NMTOKEN" use="required" />
  169. <xs:attribute name="field-name" type="xs:NMTOKEN" />
  170. <xs:attribute name="length" type="xs:NMTOKEN" />
  171. <xs:anyAttribute namespace="##other"/>
  172. </xs:complexType>
  173. <xs:complexType name="unique-constraint">
  174. <xs:sequence>
  175. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  176. </xs:sequence>
  177. <xs:attribute name="name" type="xs:NMTOKEN" use="optional"/>
  178. <xs:attribute name="columns" type="xs:string" use="required"/>
  179. <xs:anyAttribute namespace="##other"/>
  180. </xs:complexType>
  181. <xs:complexType name="unique-constraints">
  182. <xs:sequence>
  183. <xs:element name="unique-constraint" type="orm:unique-constraint" minOccurs="1" maxOccurs="unbounded"/>
  184. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  185. </xs:sequence>
  186. <xs:anyAttribute namespace="##other"/>
  187. </xs:complexType>
  188. <xs:complexType name="index">
  189. <xs:sequence>
  190. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  191. </xs:sequence>
  192. <xs:attribute name="name" type="xs:NMTOKEN" use="optional"/>
  193. <xs:attribute name="columns" type="xs:string" use="required"/>
  194. <xs:anyAttribute namespace="##other"/>
  195. </xs:complexType>
  196. <xs:complexType name="indexes">
  197. <xs:sequence>
  198. <xs:element name="index" type="orm:index" minOccurs="1" maxOccurs="unbounded"/>
  199. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  200. </xs:sequence>
  201. <xs:anyAttribute namespace="##other"/>
  202. </xs:complexType>
  203. <xs:complexType name="discriminator-mapping">
  204. <xs:sequence>
  205. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  206. </xs:sequence>
  207. <xs:attribute name="value" type="xs:NMTOKEN" use="required"/>
  208. <xs:attribute name="class" type="xs:string" use="required"/>
  209. <xs:anyAttribute namespace="##other"/>
  210. </xs:complexType>
  211. <xs:complexType name="discriminator-map">
  212. <xs:sequence>
  213. <xs:element name="discriminator-mapping" type="orm:discriminator-mapping" minOccurs="1" maxOccurs="unbounded"/>
  214. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  215. </xs:sequence>
  216. <xs:anyAttribute namespace="##other"/>
  217. </xs:complexType>
  218. <xs:complexType name="generator">
  219. <xs:sequence>
  220. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  221. </xs:sequence>
  222. <xs:attribute name="strategy" type="orm:generator-strategy" use="optional" default="AUTO" />
  223. <xs:anyAttribute namespace="##other"/>
  224. </xs:complexType>
  225. <xs:complexType name="id">
  226. <xs:sequence>
  227. <xs:element name="generator" type="orm:generator" minOccurs="0" />
  228. <xs:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0" maxOccurs="1" />
  229. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  230. </xs:sequence>
  231. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  232. <xs:attribute name="type" type="xs:NMTOKEN" />
  233. <xs:attribute name="column" type="xs:NMTOKEN" />
  234. <xs:attribute name="association-key" type="xs:boolean" default="false" />
  235. <xs:anyAttribute namespace="##other"/>
  236. </xs:complexType>
  237. <xs:complexType name="sequence-generator">
  238. <xs:sequence>
  239. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  240. </xs:sequence>
  241. <xs:attribute name="sequence-name" type="xs:NMTOKEN" use="required" />
  242. <xs:attribute name="allocation-size" type="xs:integer" use="optional" default="1" />
  243. <xs:attribute name="initial-value" type="xs:integer" use="optional" default="1" />
  244. <xs:anyAttribute namespace="##other"/>
  245. </xs:complexType>
  246. <xs:complexType name="inverse-join-columns">
  247. <xs:sequence>
  248. <xs:element name="join-column" type="orm:join-column" minOccurs="1" maxOccurs="unbounded" />
  249. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  250. </xs:sequence>
  251. <xs:anyAttribute namespace="##other"/>
  252. </xs:complexType>
  253. <xs:complexType name="join-column">
  254. <xs:sequence>
  255. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  256. </xs:sequence>
  257. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  258. <xs:attribute name="referenced-column-name" type="xs:NMTOKEN" use="optional" default="id" />
  259. <xs:attribute name="unique" type="xs:boolean" default="false" />
  260. <xs:attribute name="nullable" type="xs:boolean" default="true" />
  261. <xs:attribute name="on-delete" type="orm:fk-action" />
  262. <xs:attribute name="on-update" type="orm:fk-action" />
  263. <xs:attribute name="column-definition" type="xs:string" />
  264. <xs:anyAttribute namespace="##other"/>
  265. </xs:complexType>
  266. <xs:complexType name="join-columns">
  267. <xs:sequence>
  268. <xs:element name="join-column" type="orm:join-column" minOccurs="1" maxOccurs="unbounded" />
  269. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  270. </xs:sequence>
  271. <xs:anyAttribute namespace="##other"/>
  272. </xs:complexType>
  273. <xs:complexType name="join-table">
  274. <xs:sequence>
  275. <xs:element name="join-columns" type="orm:join-columns" />
  276. <xs:element name="inverse-join-columns" type="orm:join-columns" />
  277. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  278. </xs:sequence>
  279. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  280. <xs:attribute name="schema" type="xs:NMTOKEN" />
  281. <xs:anyAttribute namespace="##other"/>
  282. </xs:complexType>
  283. <xs:complexType name="order-by">
  284. <xs:sequence>
  285. <xs:element name="order-by-field" type="orm:order-by-field" minOccurs="1" maxOccurs="unbounded" />
  286. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  287. </xs:sequence>
  288. <xs:anyAttribute namespace="##other"/>
  289. </xs:complexType>
  290. <xs:complexType name="order-by-field">
  291. <xs:sequence>
  292. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  293. </xs:sequence>
  294. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  295. <xs:attribute name="direction" type="orm:order-by-direction" default="ASC" />
  296. <xs:anyAttribute namespace="##other"/>
  297. </xs:complexType>
  298. <xs:simpleType name="order-by-direction">
  299. <xs:restriction base="xs:token">
  300. <xs:enumeration value="ASC"/>
  301. <xs:enumeration value="DESC"/>
  302. </xs:restriction>
  303. </xs:simpleType>
  304. <xs:complexType name="many-to-many">
  305. <xs:sequence>
  306. <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
  307. <xs:element name="join-table" type="orm:join-table" minOccurs="0" />
  308. <xs:element name="order-by" type="orm:order-by" minOccurs="0" />
  309. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  310. </xs:sequence>
  311. <xs:attribute name="target-entity" type="xs:string" use="required" />
  312. <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
  313. <xs:attribute name="mapped-by" type="xs:NMTOKEN" />
  314. <xs:attribute name="index-by" type="xs:NMTOKEN" />
  315. <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
  316. <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
  317. <xs:anyAttribute namespace="##other"/>
  318. </xs:complexType>
  319. <xs:complexType name="one-to-many">
  320. <xs:sequence>
  321. <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
  322. <xs:element name="order-by" type="orm:order-by" minOccurs="0" />
  323. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  324. </xs:sequence>
  325. <xs:attribute name="target-entity" type="xs:string" use="required" />
  326. <xs:attribute name="mapped-by" type="xs:NMTOKEN" use="required" />
  327. <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
  328. <xs:attribute name="index-by" type="xs:NMTOKEN" />
  329. <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
  330. <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
  331. <xs:anyAttribute namespace="##other"/>
  332. </xs:complexType>
  333. <xs:complexType name="many-to-one">
  334. <xs:sequence>
  335. <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
  336. <xs:choice minOccurs="0" maxOccurs="1">
  337. <xs:element name="join-column" type="orm:join-column"/>
  338. <xs:element name="join-columns" type="orm:join-columns"/>
  339. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  340. </xs:choice>
  341. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  342. </xs:sequence>
  343. <xs:attribute name="target-entity" type="xs:string" use="required" />
  344. <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
  345. <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
  346. <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
  347. <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
  348. <xs:anyAttribute namespace="##other"/>
  349. </xs:complexType>
  350. <xs:complexType name="one-to-one">
  351. <xs:sequence>
  352. <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
  353. <xs:choice minOccurs="0" maxOccurs="1">
  354. <xs:element name="join-column" type="orm:join-column"/>
  355. <xs:element name="join-columns" type="orm:join-columns"/>
  356. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  357. </xs:choice>
  358. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  359. </xs:sequence>
  360. <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
  361. <xs:attribute name="target-entity" type="xs:string" use="required" />
  362. <xs:attribute name="mapped-by" type="xs:NMTOKEN" />
  363. <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
  364. <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
  365. <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
  366. <xs:anyAttribute namespace="##other"/>
  367. </xs:complexType>
  368. </xs:schema>