doctrine-mapping.xsd 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  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="named-native-query">
  77. <xs:attribute name="name" type="xs:string" use="required" />
  78. <xs:attribute name="query" type="xs:string" use="required"/>
  79. <xs:attribute name="result-class" type="xs:string" />
  80. <xs:attribute name="result-set-mapping" type="xs:string" />
  81. </xs:complexType>
  82. <xs:complexType name="named-native-queries">
  83. <xs:sequence>
  84. <xs:element name="named-native-query" type="orm:named-native-query" minOccurs="1" maxOccurs="unbounded" />
  85. <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
  86. </xs:sequence>
  87. </xs:complexType>
  88. <xs:complexType name="column-result">
  89. <xs:attribute name="name" type="xs:string" use="required" />
  90. </xs:complexType>
  91. <xs:complexType name="field-result">
  92. <xs:attribute name="name" type="xs:string" use="required" />
  93. <xs:attribute name="column" type="xs:string" />
  94. </xs:complexType>
  95. <xs:complexType name="entity-result">
  96. <xs:sequence>
  97. <xs:element name="field-result" type="orm:field-result" minOccurs="0" maxOccurs="unbounded" />
  98. </xs:sequence>
  99. <xs:attribute name="entity-class" type="xs:string" use="required" />
  100. </xs:complexType>
  101. <xs:complexType name="sql-result-set-mapping">
  102. <xs:sequence>
  103. <xs:element name="entity-result" type="orm:entity-result" minOccurs="0" maxOccurs="unbounded" />
  104. <xs:element name="column-result" type="orm:column-result" minOccurs="0" maxOccurs="unbounded" />
  105. <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
  106. </xs:sequence>
  107. </xs:complexType>
  108. <xs:complexType name="sql-result-set-mappings">
  109. <xs:sequence>
  110. <xs:element name="sql-result-set-mapping" type="orm:sql-result-set-mapping" minOccurs="1" maxOccurs="unbounded" />
  111. <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
  112. </xs:sequence>
  113. </xs:complexType>
  114. <xs:complexType name="entity">
  115. <xs:sequence>
  116. <xs:element name="options" type="orm:options" minOccurs="0" />
  117. <xs:element name="indexes" type="orm:indexes" minOccurs="0"/>
  118. <xs:element name="unique-constraints" type="orm:unique-constraints" minOccurs="0"/>
  119. <xs:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
  120. <xs:element name="discriminator-map" type="orm:discriminator-map" minOccurs="0"/>
  121. <xs:element name="lifecycle-callbacks" type="orm:lifecycle-callbacks" minOccurs="0" maxOccurs="1" />
  122. <xs:element name="named-queries" type="orm:named-queries" minOccurs="0" maxOccurs="1" />
  123. <xs:element name="named-native-queries" type="orm:named-native-queries" minOccurs="0" maxOccurs="1" />
  124. <xs:element name="id" type="orm:id" minOccurs="0" maxOccurs="unbounded" />
  125. <xs:element name="field" type="orm:field" minOccurs="0" maxOccurs="unbounded"/>
  126. <xs:element name="one-to-one" type="orm:one-to-one" minOccurs="0" maxOccurs="unbounded"/>
  127. <xs:element name="one-to-many" type="orm:one-to-many" minOccurs="0" maxOccurs="unbounded" />
  128. <xs:element name="many-to-one" type="orm:many-to-one" minOccurs="0" maxOccurs="unbounded" />
  129. <xs:element name="many-to-many" type="orm:many-to-many" minOccurs="0" maxOccurs="unbounded" />
  130. <xs:element name="association-overrides" type="orm:association-overrides" minOccurs="0" maxOccurs="unbounded" />
  131. <xs:element name="attribute-overrides" type="orm:attribute-overrides" minOccurs="0" maxOccurs="unbounded" />
  132. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  133. </xs:sequence>
  134. <xs:attribute name="name" type="xs:string" use="required" />
  135. <xs:attribute name="table" type="xs:NMTOKEN" />
  136. <xs:attribute name="schema" type="xs:NMTOKEN" />
  137. <xs:attribute name="repository-class" type="xs:string"/>
  138. <xs:attribute name="inheritance-type" type="orm:inheritance-type"/>
  139. <xs:attribute name="change-tracking-policy" type="orm:change-tracking-policy" />
  140. <xs:attribute name="read-only" type="xs:boolean" default="false" />
  141. <xs:anyAttribute namespace="##other"/>
  142. </xs:complexType>
  143. <xs:complexType name="option" mixed="true">
  144. <xs:sequence minOccurs="0" maxOccurs="unbounded">
  145. <xs:element name="option" type="orm:option"/>
  146. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  147. </xs:sequence>
  148. <xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
  149. <xs:anyAttribute namespace="##other"/>
  150. </xs:complexType>
  151. <xs:complexType name="options">
  152. <xs:sequence>
  153. <xs:element name="option" type="orm:option" minOccurs="0" maxOccurs="unbounded"/>
  154. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  155. </xs:sequence>
  156. <xs:anyAttribute namespace="##other"/>
  157. </xs:complexType>
  158. <xs:complexType name="mapped-superclass" >
  159. <xs:complexContent>
  160. <xs:extension base="orm:entity">
  161. <xs:sequence>
  162. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  163. </xs:sequence>
  164. <xs:anyAttribute namespace="##other"/>
  165. </xs:extension>
  166. </xs:complexContent>
  167. </xs:complexType>
  168. <xs:simpleType name="change-tracking-policy">
  169. <xs:restriction base="xs:token">
  170. <xs:enumeration value="DEFERRED_IMPLICIT"/>
  171. <xs:enumeration value="DEFERRED_EXPLICIT"/>
  172. <xs:enumeration value="NOTIFY"/>
  173. </xs:restriction>
  174. </xs:simpleType>
  175. <xs:simpleType name="inheritance-type">
  176. <xs:restriction base="xs:token">
  177. <xs:enumeration value="SINGLE_TABLE"/>
  178. <xs:enumeration value="JOINED"/>
  179. <xs:enumeration value="TABLE_PER_CLASS"/>
  180. </xs:restriction>
  181. </xs:simpleType>
  182. <xs:simpleType name="generator-strategy">
  183. <xs:restriction base="xs:token">
  184. <xs:enumeration value="TABLE"/>
  185. <xs:enumeration value="SEQUENCE"/>
  186. <xs:enumeration value="IDENTITY"/>
  187. <xs:enumeration value="AUTO"/>
  188. <xs:enumeration value="UUID"/>
  189. <xs:enumeration value="CUSTOM" />
  190. </xs:restriction>
  191. </xs:simpleType>
  192. <xs:simpleType name="fk-action">
  193. <xs:restriction base="xs:token">
  194. <xs:enumeration value="CASCADE"/>
  195. <xs:enumeration value="RESTRICT"/>
  196. <xs:enumeration value="SET NULL"/>
  197. </xs:restriction>
  198. </xs:simpleType>
  199. <xs:simpleType name="fetch-type">
  200. <xs:restriction base="xs:token">
  201. <xs:enumeration value="EAGER"/>
  202. <xs:enumeration value="LAZY"/>
  203. <xs:enumeration value="EXTRA_LAZY"/>
  204. </xs:restriction>
  205. </xs:simpleType>
  206. <xs:complexType name="field">
  207. <xs:sequence>
  208. <xs:element name="options" type="orm:options" minOccurs="0" />
  209. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  210. </xs:sequence>
  211. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  212. <xs:attribute name="type" type="xs:NMTOKEN" default="string" />
  213. <xs:attribute name="column" type="xs:NMTOKEN" />
  214. <xs:attribute name="length" type="xs:NMTOKEN" />
  215. <xs:attribute name="unique" type="xs:boolean" default="false" />
  216. <xs:attribute name="nullable" type="xs:boolean" default="false" />
  217. <xs:attribute name="version" type="xs:boolean" />
  218. <xs:attribute name="column-definition" type="xs:string" />
  219. <xs:attribute name="precision" type="xs:integer" use="optional" />
  220. <xs:attribute name="scale" type="xs:integer" use="optional" />
  221. <xs:anyAttribute namespace="##other"/>
  222. </xs:complexType>
  223. <xs:complexType name="discriminator-column">
  224. <xs:sequence>
  225. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  226. </xs:sequence>
  227. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  228. <xs:attribute name="type" type="xs:NMTOKEN"/>
  229. <xs:attribute name="field-name" type="xs:NMTOKEN" />
  230. <xs:attribute name="length" type="xs:NMTOKEN" />
  231. <xs:attribute name="column-definition" type="xs:string" />
  232. <xs:anyAttribute namespace="##other"/>
  233. </xs:complexType>
  234. <xs:complexType name="unique-constraint">
  235. <xs:sequence>
  236. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  237. </xs:sequence>
  238. <xs:attribute name="name" type="xs:NMTOKEN" use="optional"/>
  239. <xs:attribute name="columns" type="xs:string" use="required"/>
  240. <xs:anyAttribute namespace="##other"/>
  241. </xs:complexType>
  242. <xs:complexType name="unique-constraints">
  243. <xs:sequence>
  244. <xs:element name="unique-constraint" type="orm:unique-constraint" minOccurs="1" maxOccurs="unbounded"/>
  245. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  246. </xs:sequence>
  247. <xs:anyAttribute namespace="##other"/>
  248. </xs:complexType>
  249. <xs:complexType name="index">
  250. <xs:sequence>
  251. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  252. </xs:sequence>
  253. <xs:attribute name="name" type="xs:NMTOKEN" use="optional"/>
  254. <xs:attribute name="columns" type="xs:string" use="required"/>
  255. <xs:anyAttribute namespace="##other"/>
  256. </xs:complexType>
  257. <xs:complexType name="indexes">
  258. <xs:sequence>
  259. <xs:element name="index" type="orm:index" minOccurs="1" maxOccurs="unbounded"/>
  260. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  261. </xs:sequence>
  262. <xs:anyAttribute namespace="##other"/>
  263. </xs:complexType>
  264. <xs:complexType name="discriminator-mapping">
  265. <xs:sequence>
  266. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  267. </xs:sequence>
  268. <xs:attribute name="value" type="xs:NMTOKEN" use="required"/>
  269. <xs:attribute name="class" type="xs:string" use="required"/>
  270. <xs:anyAttribute namespace="##other"/>
  271. </xs:complexType>
  272. <xs:complexType name="discriminator-map">
  273. <xs:sequence>
  274. <xs:element name="discriminator-mapping" type="orm:discriminator-mapping" minOccurs="1" maxOccurs="unbounded"/>
  275. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  276. </xs:sequence>
  277. <xs:anyAttribute namespace="##other"/>
  278. </xs:complexType>
  279. <xs:complexType name="generator">
  280. <xs:sequence>
  281. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  282. </xs:sequence>
  283. <xs:attribute name="strategy" type="orm:generator-strategy" use="optional" default="AUTO" />
  284. <xs:anyAttribute namespace="##other"/>
  285. </xs:complexType>
  286. <xs:complexType name="id">
  287. <xs:sequence>
  288. <xs:element name="generator" type="orm:generator" minOccurs="0" />
  289. <xs:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0" maxOccurs="1" />
  290. <xs:element name="custom-id-generator" type="orm:custom-id-generator" minOccurs="0" maxOccurs="1" />
  291. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  292. </xs:sequence>
  293. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  294. <xs:attribute name="type" type="xs:NMTOKEN" />
  295. <xs:attribute name="column" type="xs:NMTOKEN" />
  296. <xs:attribute name="association-key" type="xs:boolean" default="false" />
  297. <xs:attribute name="column-definition" type="xs:string" />
  298. <xs:anyAttribute namespace="##other"/>
  299. </xs:complexType>
  300. <xs:complexType name="sequence-generator">
  301. <xs:sequence>
  302. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  303. </xs:sequence>
  304. <xs:attribute name="sequence-name" type="xs:NMTOKEN" use="required" />
  305. <xs:attribute name="allocation-size" type="xs:integer" use="optional" default="1" />
  306. <xs:attribute name="initial-value" type="xs:integer" use="optional" default="1" />
  307. <xs:anyAttribute namespace="##other"/>
  308. </xs:complexType>
  309. <xs:complexType name="custom-id-generator">
  310. <xs:sequence>
  311. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  312. </xs:sequence>
  313. <xs:attribute name="class" type="xs:NMTOKEN" use="required" />
  314. </xs:complexType>
  315. <xs:complexType name="inverse-join-columns">
  316. <xs:sequence>
  317. <xs:element name="join-column" type="orm:join-column" minOccurs="1" maxOccurs="unbounded" />
  318. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  319. </xs:sequence>
  320. <xs:anyAttribute namespace="##other"/>
  321. </xs:complexType>
  322. <xs:complexType name="join-column">
  323. <xs:sequence>
  324. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  325. </xs:sequence>
  326. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  327. <xs:attribute name="referenced-column-name" type="xs:NMTOKEN" use="optional" default="id" />
  328. <xs:attribute name="unique" type="xs:boolean" default="false" />
  329. <xs:attribute name="nullable" type="xs:boolean" default="true" />
  330. <xs:attribute name="on-delete" type="orm:fk-action" />
  331. <xs:attribute name="on-update" type="orm:fk-action" />
  332. <xs:attribute name="column-definition" type="xs:string" />
  333. <xs:anyAttribute namespace="##other"/>
  334. </xs:complexType>
  335. <xs:complexType name="join-columns">
  336. <xs:sequence>
  337. <xs:element name="join-column" type="orm:join-column" minOccurs="1" maxOccurs="unbounded" />
  338. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  339. </xs:sequence>
  340. <xs:anyAttribute namespace="##other"/>
  341. </xs:complexType>
  342. <xs:complexType name="join-table">
  343. <xs:sequence>
  344. <xs:element name="join-columns" type="orm:join-columns" />
  345. <xs:element name="inverse-join-columns" type="orm:join-columns" />
  346. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  347. </xs:sequence>
  348. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  349. <xs:attribute name="schema" type="xs:NMTOKEN" />
  350. <xs:anyAttribute namespace="##other"/>
  351. </xs:complexType>
  352. <xs:complexType name="order-by">
  353. <xs:sequence>
  354. <xs:element name="order-by-field" type="orm:order-by-field" minOccurs="1" maxOccurs="unbounded" />
  355. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  356. </xs:sequence>
  357. <xs:anyAttribute namespace="##other"/>
  358. </xs:complexType>
  359. <xs:complexType name="order-by-field">
  360. <xs:sequence>
  361. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  362. </xs:sequence>
  363. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  364. <xs:attribute name="direction" type="orm:order-by-direction" default="ASC" />
  365. <xs:anyAttribute namespace="##other"/>
  366. </xs:complexType>
  367. <xs:simpleType name="order-by-direction">
  368. <xs:restriction base="xs:token">
  369. <xs:enumeration value="ASC"/>
  370. <xs:enumeration value="DESC"/>
  371. </xs:restriction>
  372. </xs:simpleType>
  373. <xs:complexType name="many-to-many">
  374. <xs:sequence>
  375. <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
  376. <xs:element name="join-table" type="orm:join-table" minOccurs="0" />
  377. <xs:element name="order-by" type="orm:order-by" minOccurs="0" />
  378. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  379. </xs:sequence>
  380. <xs:attribute name="target-entity" type="xs:string" use="required" />
  381. <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
  382. <xs:attribute name="mapped-by" type="xs:NMTOKEN" />
  383. <xs:attribute name="index-by" type="xs:NMTOKEN" />
  384. <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
  385. <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
  386. <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
  387. <xs:anyAttribute namespace="##other"/>
  388. </xs:complexType>
  389. <xs:complexType name="one-to-many">
  390. <xs:sequence>
  391. <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
  392. <xs:element name="order-by" type="orm:order-by" minOccurs="0" />
  393. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  394. </xs:sequence>
  395. <xs:attribute name="target-entity" type="xs:string" use="required" />
  396. <xs:attribute name="mapped-by" type="xs:NMTOKEN" use="required" />
  397. <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
  398. <xs:attribute name="index-by" type="xs:NMTOKEN" />
  399. <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
  400. <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
  401. <xs:anyAttribute namespace="##other"/>
  402. </xs:complexType>
  403. <xs:complexType name="many-to-one">
  404. <xs:sequence>
  405. <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
  406. <xs:choice minOccurs="0" maxOccurs="1">
  407. <xs:element name="join-column" type="orm:join-column"/>
  408. <xs:element name="join-columns" type="orm:join-columns"/>
  409. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  410. </xs:choice>
  411. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  412. </xs:sequence>
  413. <xs:attribute name="target-entity" type="xs:string" use="required" />
  414. <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
  415. <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
  416. <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
  417. <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
  418. <xs:anyAttribute namespace="##other"/>
  419. </xs:complexType>
  420. <xs:complexType name="one-to-one">
  421. <xs:sequence>
  422. <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
  423. <xs:choice minOccurs="0" maxOccurs="1">
  424. <xs:element name="join-column" type="orm:join-column"/>
  425. <xs:element name="join-columns" type="orm:join-columns"/>
  426. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  427. </xs:choice>
  428. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  429. </xs:sequence>
  430. <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
  431. <xs:attribute name="target-entity" type="xs:string" use="required" />
  432. <xs:attribute name="mapped-by" type="xs:NMTOKEN" />
  433. <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
  434. <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
  435. <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
  436. <xs:anyAttribute namespace="##other"/>
  437. </xs:complexType>
  438. <xs:complexType name="association-overrides">
  439. <xs:sequence>
  440. <xs:element name="association-override" type="orm:association-override" minOccurs="1" maxOccurs="unbounded" />
  441. <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
  442. </xs:sequence>
  443. </xs:complexType>
  444. <xs:complexType name="association-override">
  445. <xs:sequence>
  446. <xs:element name="join-table" type="orm:join-table" minOccurs="0" />
  447. <xs:element name="join-columns" type="orm:join-columns" minOccurs="0" />
  448. <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
  449. </xs:sequence>
  450. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  451. </xs:complexType>
  452. <xs:complexType name="attribute-overrides">
  453. <xs:sequence>
  454. <xs:element name="attribute-override" type="orm:attribute-override" minOccurs="1" maxOccurs="unbounded" />
  455. <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
  456. </xs:sequence>
  457. </xs:complexType>
  458. <xs:complexType name="attribute-override">
  459. <xs:sequence>
  460. <xs:element name="field" type="orm:field" minOccurs="1" />
  461. <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
  462. </xs:sequence>
  463. <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
  464. </xs:complexType>
  465. </xs:schema>