Permalink
Newer
Older
100644 410 lines (369 sloc) 17.3 KB
1
<?xml version="1.0" encoding="UTF-8"?>
2
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">
8
<xs:annotation>
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>
13
</xs:annotation>
14
15
<xs:element name="doctrine-mapping">
16
<xs:complexType>
17
<xs:sequence>
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"/>
23
</xs:complexType>
24
</xs:element>
25
26
<xs:complexType name="emptyType">
27
<xs:sequence>
28
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
29
</xs:sequence>
30
<xs:anyAttribute namespace="##other"/>
31
</xs:complexType>
32
33
<xs:complexType name="cascade-type">
34
<xs:sequence>
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"/>
54
</xs:restriction>
55
</xs:simpleType>
56
57
<xs:complexType name="lifecycle-callback">
58
<xs:sequence>
59
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
60
</xs:sequence>
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"/>
78
</xs:complexType>
79
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
87
<xs:complexType name="entity">
88
<xs:sequence>
89
<xs:element name="indexes" type="orm:indexes" minOccurs="0"/>
90
<xs:element name="unique-constraints" type="orm:unique-constraints" minOccurs="0"/>
91
<xs:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
92
<xs:element name="discriminator-map" type="orm:discriminator-map" minOccurs="0"/>
93
<xs:element name="lifecycle-callbacks" type="orm:lifecycle-callbacks" minOccurs="0" maxOccurs="1" />
94
<xs:element name="named-queries" type="orm:named-queries" minOccurs="0" maxOccurs="1" />
95
<xs:element name="id" type="orm:id" minOccurs="0" maxOccurs="unbounded" />
96
<xs:element name="field" type="orm:field" minOccurs="0" maxOccurs="unbounded"/>
97
<xs:element name="one-to-one" type="orm:one-to-one" minOccurs="0" maxOccurs="unbounded"/>
98
<xs:element name="one-to-many" type="orm:one-to-many" minOccurs="0" maxOccurs="unbounded" />
99
<xs:element name="many-to-one" type="orm:many-to-one" minOccurs="0" maxOccurs="unbounded" />
100
<xs:element name="many-to-many" type="orm:many-to-many" minOccurs="0" maxOccurs="unbounded" />
101
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
102
</xs:sequence>
103
<xs:attribute name="name" type="xs:string" use="required" />
104
<xs:attribute name="table" type="xs:NMTOKEN" />
105
<xs:attribute name="schema" type="xs:NMTOKEN" />
@beberlei
Dec 21, 2010
106
<xs:attribute name="repository-class" type="xs:string"/>
107
<xs:attribute name="inheritance-type" type="orm:inheritance-type"/>
108
<xs:attribute name="change-tracking-policy" type="orm:change-tracking-policy" />
109
<xs:attribute name="read-only" type="xs:boolean" default="false" />
110
<xs:anyAttribute namespace="##other"/>
113
<xs:complexType name="mapped-superclass" >
114
<xs:complexContent>
115
<xs:extension base="orm:entity">
116
<xs:sequence>
117
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
118
</xs:sequence>
119
<xs:anyAttribute namespace="##other"/>
120
</xs:extension>
123
124
<xs:simpleType name="change-tracking-policy">
125
<xs:restriction base="xs:token">
126
<xs:enumeration value="DEFERRED_IMPLICIT"/>
127
<xs:enumeration value="DEFERRED_EXPLICIT"/>
128
<xs:enumeration value="NOTIFY"/>
129
</xs:restriction>
130
</xs:simpleType>
131
132
<xs:simpleType name="inheritance-type">
133
<xs:restriction base="xs:token">
134
<xs:enumeration value="SINGLE_TABLE"/>
135
<xs:enumeration value="JOINED"/>
136
<xs:enumeration value="TABLE_PER_CLASS"/>
137
</xs:restriction>
138
</xs:simpleType>
139
140
<xs:simpleType name="generator-strategy">
141
<xs:restriction base="xs:token">
142
<xs:enumeration value="TABLE"/>
143
<xs:enumeration value="SEQUENCE"/>
144
<xs:enumeration value="IDENTITY"/>
145
<xs:enumeration value="AUTO"/>
146
</xs:restriction>
147
</xs:simpleType>
148
149
<xs:simpleType name="fk-action">
150
<xs:restriction base="xs:token">
151
<xs:enumeration value="CASCADE"/>
152
<xs:enumeration value="RESTRICT"/>
153
<xs:enumeration value="SET NULL"/>
155
</xs:simpleType>
156
157
<xs:simpleType name="fetch-type">
158
<xs:restriction base="xs:token">
159
<xs:enumeration value="EAGER"/>
160
<xs:enumeration value="LAZY"/>
161
<xs:enumeration value="EXTRALAZY"/>
162
</xs:restriction>
164
165
<xs:complexType name="field">
166
<xs:sequence>
167
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
168
</xs:sequence>
169
<xs:attribute name="name" type="xs:NMTOKEN" use="required" />
170
<xs:attribute name="type" type="xs:NMTOKEN" default="string" />
171
<xs:attribute name="column" type="xs:NMTOKEN" />
172
<xs:attribute name="length" type="xs:NMTOKEN" />
173
<xs:attribute name="unique" type="xs:boolean" default="false" />
174
<xs:attribute name="nullable" type="xs:boolean" default="false" />
175
<xs:attribute name="version" type="xs:boolean" />
176
<xs:attribute name="column-definition" type="xs:string" />
177
<xs:attribute name="precision" type="xs:integer" use="optional" />
178
<xs:attribute name="scale" type="xs:integer" use="optional" />
179
<xs:anyAttribute namespace="##other"/>
180
</xs:complexType>
181
182
<xs:complexType name="discriminator-column">
183
<xs:sequence>
184
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
185
</xs:sequence>
186
<xs:attribute name="name" type="xs:NMTOKEN" use="required" />
187
<xs:attribute name="type" type="xs:NMTOKEN" use="required" />
188
<xs:attribute name="field-name" type="xs:NMTOKEN" />
189
<xs:attribute name="length" type="xs:NMTOKEN" />
190
<xs:anyAttribute namespace="##other"/>
192
193
<xs:complexType name="unique-constraint">
194
<xs:sequence>
195
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
196
</xs:sequence>
197
<xs:attribute name="name" type="xs:NMTOKEN" use="optional"/>
198
<xs:attribute name="columns" type="xs:string" use="required"/>
199
<xs:anyAttribute namespace="##other"/>
200
</xs:complexType>
201
202
<xs:complexType name="unique-constraints">
203
<xs:sequence>
204
<xs:element name="unique-constraint" type="orm:unique-constraint" minOccurs="1" maxOccurs="unbounded"/>
205
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
206
</xs:sequence>
207
<xs:anyAttribute namespace="##other"/>
208
</xs:complexType>
209
210
<xs:complexType name="index">
211
<xs:sequence>
212
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
213
</xs:sequence>
214
<xs:attribute name="name" type="xs:NMTOKEN" use="optional"/>
215
<xs:attribute name="columns" type="xs:string" use="required"/>
216
<xs:anyAttribute namespace="##other"/>
217
</xs:complexType>
218
219
<xs:complexType name="indexes">
220
<xs:sequence>
221
<xs:element name="index" type="orm:index" minOccurs="1" maxOccurs="unbounded"/>
222
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
223
</xs:sequence>
224
<xs:anyAttribute namespace="##other"/>
225
</xs:complexType>
226
227
<xs:complexType name="discriminator-mapping">
228
<xs:sequence>
229
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
230
</xs:sequence>
231
<xs:attribute name="value" type="xs:NMTOKEN" use="required"/>
232
<xs:attribute name="class" type="xs:string" use="required"/>
233
<xs:anyAttribute namespace="##other"/>
234
</xs:complexType>
235
236
<xs:complexType name="discriminator-map">
237
<xs:sequence>
238
<xs:element name="discriminator-mapping" type="orm:discriminator-mapping" minOccurs="1" maxOccurs="unbounded"/>
239
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
240
</xs:sequence>
241
<xs:anyAttribute namespace="##other"/>
242
</xs:complexType>
243
244
<xs:complexType name="generator">
245
<xs:sequence>
246
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
247
</xs:sequence>
248
<xs:attribute name="strategy" type="orm:generator-strategy" use="optional" default="AUTO" />
249
<xs:anyAttribute namespace="##other"/>
250
</xs:complexType>
251
252
<xs:complexType name="id">
253
<xs:sequence>
254
<xs:element name="generator" type="orm:generator" minOccurs="0" />
255
<xs:element name="sequence-generator" type="orm:sequence-generator" minOccurs="0" maxOccurs="1" />
256
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
257
</xs:sequence>
258
<xs:attribute name="name" type="xs:NMTOKEN" use="required" />
259
<xs:attribute name="type" type="xs:NMTOKEN" />
260
<xs:attribute name="column" type="xs:NMTOKEN" />
261
<xs:attribute name="association-key" type="xs:boolean" default="false" />
262
<xs:anyAttribute namespace="##other"/>
265
<xs:complexType name="sequence-generator">
266
<xs:sequence>
267
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
268
</xs:sequence>
269
<xs:attribute name="sequence-name" type="xs:NMTOKEN" use="required" />
270
<xs:attribute name="allocation-size" type="xs:integer" use="optional" default="1" />
271
<xs:attribute name="initial-value" type="xs:integer" use="optional" default="1" />
272
<xs:anyAttribute namespace="##other"/>
275
<xs:complexType name="inverse-join-columns">
276
<xs:sequence>
277
<xs:element name="join-column" type="orm:join-column" minOccurs="1" maxOccurs="unbounded" />
278
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
280
<xs:anyAttribute namespace="##other"/>
281
</xs:complexType>
282
283
<xs:complexType name="join-column">
284
<xs:sequence>
285
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
286
</xs:sequence>
287
<xs:attribute name="name" type="xs:NMTOKEN" use="required" />
288
<xs:attribute name="referenced-column-name" type="xs:NMTOKEN" use="optional" default="id" />
289
<xs:attribute name="unique" type="xs:boolean" default="false" />
290
<xs:attribute name="nullable" type="xs:boolean" default="true" />
291
<xs:attribute name="on-delete" type="orm:fk-action" />
292
<xs:attribute name="on-update" type="orm:fk-action" />
293
<xs:attribute name="column-definition" type="xs:string" />
294
<xs:anyAttribute namespace="##other"/>
295
</xs:complexType>
296
297
<xs:complexType name="join-columns">
298
<xs:sequence>
299
<xs:element name="join-column" type="orm:join-column" minOccurs="1" maxOccurs="unbounded" />
300
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
302
<xs:anyAttribute namespace="##other"/>
303
</xs:complexType>
304
305
<xs:complexType name="join-table">
306
<xs:sequence>
307
<xs:element name="join-columns" type="orm:join-columns" />
308
<xs:element name="inverse-join-columns" type="orm:join-columns" />
309
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
310
</xs:sequence>
311
<xs:attribute name="name" type="xs:NMTOKEN" use="required" />
312
<xs:attribute name="schema" type="xs:NMTOKEN" />
313
<xs:anyAttribute namespace="##other"/>
316
<xs:complexType name="order-by">
317
<xs:sequence>
318
<xs:element name="order-by-field" type="orm:order-by-field" minOccurs="1" maxOccurs="unbounded" />
319
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
320
</xs:sequence>
321
<xs:anyAttribute namespace="##other"/>
322
</xs:complexType>
323
324
<xs:complexType name="order-by-field">
325
<xs:sequence>
326
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
327
</xs:sequence>
328
<xs:attribute name="name" type="xs:NMTOKEN" use="required" />
329
<xs:attribute name="direction" type="orm:order-by-direction" default="ASC" />
330
<xs:anyAttribute namespace="##other"/>
331
</xs:complexType>
332
333
<xs:simpleType name="order-by-direction">
334
<xs:restriction base="xs:token">
335
<xs:enumeration value="ASC"/>
336
<xs:enumeration value="DESC"/>
337
</xs:restriction>
338
</xs:simpleType>
339
340
<xs:complexType name="many-to-many">
341
<xs:sequence>
342
<xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
343
<xs:element name="join-table" type="orm:join-table" minOccurs="0" />
344
<xs:element name="order-by" type="orm:order-by" minOccurs="0" />
345
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
@beberlei
Dec 21, 2010
347
<xs:attribute name="target-entity" type="xs:string" use="required" />
348
<xs:attribute name="field" type="xs:NMTOKEN" use="required" />
349
<xs:attribute name="mapped-by" type="xs:NMTOKEN" />
350
<xs:attribute name="index-by" type="xs:NMTOKEN" />
@romanb
Apr 9, 2010
351
<xs:attribute name="inversed-by" type="xs:NMTOKEN" />
352
<xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
353
<xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
354
<xs:anyAttribute namespace="##other"/>
355
</xs:complexType>
356
357
<xs:complexType name="one-to-many">
358
<xs:sequence>
359
<xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
360
<xs:element name="order-by" type="orm:order-by" minOccurs="0" />
361
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
@beberlei
Dec 21, 2010
363
<xs:attribute name="target-entity" type="xs:string" use="required" />
@romanb
Apr 9, 2010
364
<xs:attribute name="mapped-by" type="xs:NMTOKEN" use="required" />
365
<xs:attribute name="field" type="xs:NMTOKEN" use="required" />
366
<xs:attribute name="index-by" type="xs:NMTOKEN" />
367
<xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
368
<xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
369
<xs:anyAttribute namespace="##other"/>
370
</xs:complexType>
371
372
<xs:complexType name="many-to-one">
373
<xs:sequence>
374
<xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
375
<xs:choice minOccurs="0" maxOccurs="1">
376
<xs:element name="join-column" type="orm:join-column"/>
377
<xs:element name="join-columns" type="orm:join-columns"/>
378
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
379
</xs:choice>
380
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
381
</xs:sequence>
@beberlei
Dec 21, 2010
382
<xs:attribute name="target-entity" type="xs:string" use="required" />
383
<xs:attribute name="field" type="xs:NMTOKEN" use="required" />
384
<xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
385
<xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
@romanb
Apr 9, 2010
386
<xs:attribute name="inversed-by" type="xs:NMTOKEN" />
387
<xs:anyAttribute namespace="##other"/>
388
</xs:complexType>
389
390
<xs:complexType name="one-to-one">
391
<xs:sequence>
392
<xs:element name="cascade" type="orm:cascade-type" minOccurs="0" />
393
<xs:choice minOccurs="0" maxOccurs="1">
394
<xs:element name="join-column" type="orm:join-column"/>
395
<xs:element name="join-columns" type="orm:join-columns"/>
396
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
398
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
@romanb
Apr 9, 2010
400
<xs:attribute name="field" type="xs:NMTOKEN" use="required" />
@beberlei
Dec 21, 2010
401
<xs:attribute name="target-entity" type="xs:string" use="required" />
402
<xs:attribute name="mapped-by" type="xs:NMTOKEN" />
@romanb
Apr 9, 2010
403
<xs:attribute name="inversed-by" type="xs:NMTOKEN" />
404
<xs:attribute name="orphan-removal" type="xs:boolean" default="false" />
405
<xs:attribute name="fetch" type="orm:fetch-type" default="LAZY" />
406
<xs:anyAttribute namespace="##other"/>
@beberlei
Dec 21, 2010
409
</xs:schema>