doctrine-mapping.xsd 24 KB

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