1 <?xml version="1.0" encoding="UTF-8"?>
3 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
4 targetNamespace="http://doctrine-project.org/schemas/orm/doctrine-mapping"
5 xmlns:orm="http://doctrine-project.org/schemas/orm/doctrine-mapping"
6 elementFormDefault="qualified">
9 <xs:documentation><![CDATA[
10 This is the XML Schema for the object/relational
11 mapping file used by the Doctrine ORM.
12 ]]></xs:documentation>
15 <xs:element name="doctrine-mapping">
18 <xs:element name="mapped-superclass" type="orm:mapped-superclass" minOccurs="0" maxOccurs="unbounded" />
19 <xs:element name="entity" type="orm:entity" minOccurs="0" maxOccurs="unbounded" />
20 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
22 <xs:anyAttribute namespace="##other"/>
26 <xs:complexType name="emptyType">
28 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
30 <xs:anyAttribute namespace="##other"/>
33 <xs:complexType name="cascade-type">
35 <xs:element name="cascade-all" type="orm:emptyType" minOccurs="0"/>
36 <xs:element name="cascade-persist" type="orm:emptyType" minOccurs="0"/>
37 <xs:element name="cascade-merge" type="orm:emptyType" minOccurs="0"/>
38 <xs:element name="cascade-remove" type="orm:emptyType" minOccurs="0"/>
39 <xs:element name="cascade-refresh" type="orm:emptyType" minOccurs="0"/>
40 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
42 <xs:anyAttribute namespace="##other"/>
45 <xs:simpleType name="lifecycle-callback-type">
46 <xs:restriction base="xs:token">
47 <xs:enumeration value="prePersist"/>
48 <xs:enumeration value="postPersist"/>
49 <xs:enumeration value="preUpdate"/>
50 <xs:enumeration value="postUpdate"/>
51 <xs:enumeration value="preRemove"/>
52 <xs:enumeration value="postRemove"/>
53 <xs:enumeration value="postLoad"/>
57 <xs:complexType name="lifecycle-callback">
59 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
61 <xs:attribute name="type" type="orm:lifecycle-callback-type" use="required" />
62 <xs:attribute name="method" type="xs:NMTOKEN" use="required" />
63 <xs:anyAttribute namespace="##other"/>
66 <xs:complexType name="lifecycle-callbacks">
68 <xs:element name="lifecycle-callback" type="orm:lifecycle-callback" minOccurs="1" maxOccurs="unbounded" />
69 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
71 <xs:anyAttribute namespace="##other"/>
74 <xs:complexType name="named-query">
75 <xs:attribute name="name" type="xs:string" use="required" />
76 <xs:attribute name="query" type="xs:string" use="required" />
77 <xs:anyAttribute namespace="##other"/>
80 <xs:complexType name="named-queries">
82 <xs:element name="named-query" type="orm:named-query" minOccurs="1" maxOccurs="unbounded" />
83 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
87 <xs:complexType name="named-native-query">
88 <xs:attribute name="name" type="xs:string" use="required" />
89 <xs:attribute name="query" type="xs:string" use="required"/>
90 <xs:attribute name="result-class" type="xs:string" />
91 <xs:attribute name="result-set-mapping" type="xs:string" />
94 <xs:complexType name="named-native-queries">
96 <xs:element name="named-native-query" type="orm:named-native-query" minOccurs="1" maxOccurs="unbounded" />
97 <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
101 <xs:complexType name="column-result">
102 <xs:attribute name="name" type="xs:string" use="required" />
105 <xs:complexType name="field-result">
106 <xs:attribute name="name" type="xs:string" use="required" />
107 <xs:attribute name="column" type="xs:string" />
110 <xs:complexType name="entity-result">
112 <xs:element name="field-result" type="orm:field-result" minOccurs="0" maxOccurs="unbounded" />
114 <xs:attribute name="entity-class" type="xs:string" use="required" />
117 <xs:complexType name="sql-result-set-mapping">
119 <xs:element name="entity-result" type="orm:entity-result" minOccurs="0" maxOccurs="unbounded" />
120 <xs:element name="column-result" type="orm:column-result" minOccurs="0" maxOccurs="unbounded" />
121 <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
125 <xs:complexType name="sql-result-set-mappings">
127 <xs:element name="sql-result-set-mapping" type="orm:sql-result-set-mapping" minOccurs="1" maxOccurs="unbounded" />
128 <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
132 <xs:complexType name="entity">
134 <xs:element name="options" type="orm:options" minOccurs="0" />
135 <xs:element name="indexes" type="orm:indexes" minOccurs="0"/>
136 <xs:element name="unique-constraints" type="orm:unique-constraints" minOccurs="0"/>
137 <xs:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
138 <xs:element name="discriminator-map" type="orm:discriminator-map" minOccurs="0"/>
139 <xs:element name="lifecycle-callbacks" type="orm:lifecycle-callbacks" minOccurs="0" maxOccurs="1" />
140 <xs:element name="named-queries" type="orm:named-queries" minOccurs="0" maxOccurs="1" />
141 <xs:element name="named-native-queries" type="orm:named-native-queries" minOccurs="0" maxOccurs="1" />
142 <xs:element name="id" type="orm:id" minOccurs="0" maxOccurs="unbounded" />
143 <xs:element name="field" type="orm:field" minOccurs="0" maxOccurs="unbounded"/>
144 <xs:element name="one-to-one" type="orm:one-to-one" minOccurs="0" maxOccurs="unbounded"/>
145 <xs:element name="one-to-many" type="orm:one-to-many" minOccurs="0" maxOccurs="unbounded" />
146 <xs:element name="many-to-one" type="orm:many-to-one" minOccurs="0" maxOccurs="unbounded" />
147 <xs:element name="many-to-many" type="orm:many-to-many" minOccurs="0" maxOccurs="unbounded" />
148 <xs:element name="association-overrides" type="orm:association-overrides" minOccurs="0" maxOccurs="unbounded" />
149 <xs:element name="attribute-overrides" type="orm:attribute-overrides" minOccurs="0" maxOccurs="unbounded" />
150 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
152 <xs:attribute name="name" type="xs:string" use="required" />
153 <xs:attribute name="table" type="xs:NMTOKEN" />
154 <xs:attribute name="schema" type="xs:NMTOKEN" />
155 <xs:attribute name="repository-class" type="xs:string"/>
156 <xs:attribute name="inheritance-type" type="orm:inheritance-type"/>
157 <xs:attribute name="change-tracking-policy" type="orm:change-tracking-policy" />
158 <xs:attribute name="read-only" type="xs:boolean" default="false" />
159 <xs:anyAttribute namespace="##other"/>
162 <xs:complexType name="option" mixed="true">
163 <xs:sequence minOccurs="0" maxOccurs="unbounded">
164 <xs:element name="option" type="orm:option"/>
165 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
167 <xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
168 <xs:anyAttribute namespace="##other"/>
171 <xs:complexType name="options">
173 <xs:element name="option" type="orm:option" minOccurs="0" maxOccurs="unbounded"/>
174 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
176 <xs:anyAttribute namespace="##other"/>
179 <xs:complexType name="mapped-superclass" >
181 <xs:extension base="orm:entity">
183 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
185 <xs:anyAttribute namespace="##other"/>
190 <xs:simpleType name="change-tracking-policy">
191 <xs:restriction base="xs:token">
192 <xs:enumeration value="DEFERRED_IMPLICIT"/>
193 <xs:enumeration value="DEFERRED_EXPLICIT"/>
194 <xs:enumeration value="NOTIFY"/>
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"/>
206 <xs:simpleType name="generator-strategy">
207 <xs:restriction base="xs:token">
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" />
217 <xs:simpleType name="fk-action">
218 <xs:restriction base="xs:token">
219 <xs:enumeration value="CASCADE"/>
220 <xs:enumeration value="RESTRICT"/>
221 <xs:enumeration value="SET NULL"/>
225 <xs:simpleType name="fetch-type">
226 <xs:restriction base="xs:token">
227 <xs:enumeration value="EAGER"/>
228 <xs:enumeration value="LAZY"/>
229 <xs:enumeration value="EXTRA_LAZY"/>
233 <xs:complexType name="field">
235 <xs:element name="options" type="orm:options" minOccurs="0" />
236 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
238 <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
239 <xs:attribute name="type" type="xs:NMTOKEN" default="string" />
240 <xs:attribute name="column" type="xs:NMTOKEN" />
241 <xs:attribute name="length" type="xs:NMTOKEN" />
242 <xs:attribute name="unique" type="xs:boolean" default="false" />
243 <xs:attribute name="nullable" type="xs:boolean" default="false" />
244 <xs:attribute name="version" type="xs:boolean" />
245 <xs:attribute name="column-definition" type="xs:string" />
246 <xs:attribute name="precision" type="xs:integer" use="optional" />
247 <xs:attribute name="scale" type="xs:integer" use="optional" />
248 <xs:anyAttribute namespace="##other"/>
251 <xs:complexType name="discriminator-column">
253 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
255 <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
256 <xs:attribute name="type" type="xs:NMTOKEN"/>
257 <xs:attribute name="field-name" type="xs:NMTOKEN" />
258 <xs:attribute name="length" type="xs:NMTOKEN" />
259 <xs:attribute name="column-definition" type="xs:string" />
260 <xs:anyAttribute namespace="##other"/>
263 <xs:complexType name="unique-constraint">
265 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
267 <xs:attribute name="name" type="xs:NMTOKEN" use="optional"/>
268 <xs:attribute name="columns" type="xs:string" use="required"/>
269 <xs:anyAttribute namespace="##other"/>
272 <xs:complexType name="unique-constraints">
274 <xs:element name="unique-constraint" type="orm:unique-constraint" minOccurs="1" maxOccurs="unbounded"/>
275 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
277 <xs:anyAttribute namespace="##other"/>
280 <xs:complexType name="index">
282 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
284 <xs:attribute name="name" type="xs:NMTOKEN" use="optional"/>
285 <xs:attribute name="columns" type="xs:string" use="required"/>
286 <xs:anyAttribute namespace="##other"/>
289 <xs:complexType name="indexes">
291 <xs:element name="index" type="orm:index" minOccurs="1" maxOccurs="unbounded"/>
292 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
294 <xs:anyAttribute namespace="##other"/>
297 <xs:complexType name="discriminator-mapping">
299 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
301 <xs:attribute name="value" type="xs:NMTOKEN" use="required"/>
302 <xs:attribute name="class" type="xs:string" use="required"/>
303 <xs:anyAttribute namespace="##other"/>
306 <xs:complexType name="discriminator-map">
308 <xs:element name="discriminator-mapping" type="orm:discriminator-mapping" minOccurs="1" maxOccurs="unbounded"/>
309 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
311 <xs:anyAttribute namespace="##other"/>
314 <xs:complexType name="generator">
316 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
318 <xs:attribute name="strategy" type="orm:generator-strategy" use="optional" default="AUTO" />
319 <xs:anyAttribute namespace="##other"/>
322 <xs:complexType name="id">
324 <xs:element name="generator" type="orm:generator" minOccurs="0" />
325 <xs:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0" maxOccurs="1" />
326 <xs:element name="custom-id-generator" type="orm:custom-id-generator" minOccurs="0" maxOccurs="1" />
327 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
329 <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
330 <xs:attribute name="type" type="xs:NMTOKEN" />
331 <xs:attribute name="column" type="xs:NMTOKEN" />
332 <xs:attribute name="association-key" type="xs:boolean" default="false" />
333 <xs:attribute name="column-definition" type="xs:string" />
334 <xs:anyAttribute namespace="##other"/>
337 <xs:complexType name="sequence-generator">
339 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
341 <xs:attribute name="sequence-name" type="xs:NMTOKEN" use="required" />
342 <xs:attribute name="allocation-size" type="xs:integer" use="optional" default="1" />
343 <xs:attribute name="initial-value" type="xs:integer" use="optional" default="1" />
344 <xs:anyAttribute namespace="##other"/>
347 <xs:complexType name="custom-id-generator">
349 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
351 <xs:attribute name="class" type="xs:NMTOKEN" use="required" />
354 <xs:complexType name="inverse-join-columns">
356 <xs:element name="join-column" type="orm:join-column" minOccurs="1" maxOccurs="unbounded" />
357 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
359 <xs:anyAttribute namespace="##other"/>
362 <xs:complexType name="join-column">
364 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
366 <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
367 <xs:attribute name="referenced-column-name" type="xs:NMTOKEN" use="optional" default="id" />
368 <xs:attribute name="unique" type="xs:boolean" default="false" />
369 <xs:attribute name="nullable" type="xs:boolean" default="true" />
370 <xs:attribute name="on-delete" type="orm:fk-action" />
371 <xs:attribute name="on-update" type="orm:fk-action" />
372 <xs:attribute name="column-definition" type="xs:string" />
373 <xs:anyAttribute namespace="##other"/>
376 <xs:complexType name="join-columns">
378 <xs:element name="join-column" type="orm:join-column" minOccurs="1" maxOccurs="unbounded" />
379 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
381 <xs:anyAttribute namespace="##other"/>
384 <xs:complexType name="join-table">
386 <xs:element name="join-columns" type="orm:join-columns" />
387 <xs:element name="inverse-join-columns" type="orm:join-columns" />
388 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
390 <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
391 <xs:attribute name="schema" type="xs:NMTOKEN" />
392 <xs:anyAttribute namespace="##other"/>
395 <xs:complexType name="order-by">
397 <xs:element name="order-by-field" type="orm:order-by-field" minOccurs="1" maxOccurs="unbounded" />
398 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
400 <xs:anyAttribute namespace="##other"/>
403 <xs:complexType name="order-by-field">
405 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
407 <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
408 <xs:attribute name="direction" type="orm:order-by-direction" default="ASC" />
409 <xs:anyAttribute namespace="##other"/>
412 <xs:simpleType name="order-by-direction">
413 <xs:restriction base="xs:token">
414 <xs:enumeration value="ASC"/>
415 <xs:enumeration value="DESC"/>
419 <xs:complexType name="many-to-many">
421 <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
422 <xs:element name="join-table" type="orm:join-table" minOccurs="0" />
423 <xs:element name="order-by" type="orm:order-by" minOccurs="0" />
424 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
426 <xs:attribute name="target-entity" type="xs:string" use="required" />
427 <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
428 <xs:attribute name="mapped-by" type="xs:NMTOKEN" />
429 <xs:attribute name="index-by" type="xs:NMTOKEN" />
430 <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
431 <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
432 <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
433 <xs:anyAttribute namespace="##other"/>
436 <xs:complexType name="one-to-many">
438 <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
439 <xs:element name="order-by" type="orm:order-by" minOccurs="0" />
440 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
442 <xs:attribute name="target-entity" type="xs:string" use="required" />
443 <xs:attribute name="mapped-by" type="xs:NMTOKEN" use="required" />
444 <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
445 <xs:attribute name="index-by" type="xs:NMTOKEN" />
446 <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
447 <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
448 <xs:anyAttribute namespace="##other"/>
451 <xs:complexType name="many-to-one">
453 <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
454 <xs:choice minOccurs="0" maxOccurs="1">
455 <xs:element name="join-column" type="orm:join-column"/>
456 <xs:element name="join-columns" type="orm:join-columns"/>
457 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
459 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
461 <xs:attribute name="target-entity" type="xs:string" use="required" />
462 <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
463 <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
464 <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
465 <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
466 <xs:anyAttribute namespace="##other"/>
469 <xs:complexType name="one-to-one">
471 <xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
472 <xs:choice minOccurs="0" maxOccurs="1">
473 <xs:element name="join-column" type="orm:join-column"/>
474 <xs:element name="join-columns" type="orm:join-columns"/>
475 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
477 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
479 <xs:attribute name="field" type="xs:NMTOKEN" use="required" />
480 <xs:attribute name="target-entity" type="xs:string" use="required" />
481 <xs:attribute name="mapped-by" type="xs:NMTOKEN" />
482 <xs:attribute name="inversed-by" type="xs:NMTOKEN" />
483 <xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
484 <xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
485 <xs:anyAttribute namespace="##other"/>
488 <xs:complexType name="association-overrides">
490 <xs:element name="association-override" type="orm:association-override" minOccurs="1" maxOccurs="unbounded" />
491 <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
495 <xs:complexType name="association-override">
497 <xs:element name="join-table" type="orm:join-table" minOccurs="0" />
498 <xs:element name="join-columns" type="orm:join-columns" minOccurs="0" />
499 <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
501 <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
504 <xs:complexType name="attribute-overrides">
506 <xs:element name="attribute-override" type="orm:attribute-override" minOccurs="1" maxOccurs="unbounded" />
507 <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
511 <xs:complexType name="attribute-override">
513 <xs:element name="field" type="orm:field" minOccurs="1" />
514 <xs:any minOccurs="1" maxOccurs="unbounded" namespace="##other"/>
516 <xs:attribute name="name" type="xs:NMTOKEN" use="required" />