doctrine-mapping.xsd 27 KB

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