GRAILS-1019: Allowing expressions to be used with the 'disabled' attribute for g...
[grails.git] / test / persistence / hibernate-mapping-2.0.dtd
blobe49ffa410271e34d280f0c197f5209b7c3dafd25
1 <!-- Hibernate Mapping DTD.
3 <!DOCTYPE hibernate-mapping PUBLIC
4 "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
5 "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
7 An instance of this XML document may contain mappings for an arbitrary
8 number of classes. The class mappings may contain associations to classes
9 mapped in the same document or in another document. No class may be
10 mapped more than once. Each document may also contain definitions of an
11 arbitrary number of queries, and import declarations of arbitrary classes.
13 -->
15 <!-- The document root. -->
17 <!ELEMENT hibernate-mapping (meta*, import*, (class|subclass|joined-subclass)*, query*, sql-query*)>
18 <!ATTLIST hibernate-mapping schema CDATA #IMPLIED> <!-- default: none -->
19 <!ATTLIST hibernate-mapping default-cascade (none|save-update|all) "none">
20 <!ATTLIST hibernate-mapping default-access CDATA "property">
21 <!ATTLIST hibernate-mapping auto-import (true|false) "true">
22 <!ATTLIST hibernate-mapping package CDATA #IMPLIED> <!-- default: none -->
24 <!-- An explicit query language "import" -->
26 <!ELEMENT import EMPTY>
27 <!ATTLIST import class CDATA #REQUIRED>
28 <!ATTLIST import rename CDATA #IMPLIED> <!-- default: unqualified class name -->
30 <!-- Root of an entity class hierarchy. Entities have their own tables. -->
32 <!ELEMENT class (
33 meta*,
34 (cache|jcs-cache)?,
35 (id|composite-id),
36 discriminator?,
37 (version|timestamp)?,
38 (property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array)*,
39 ((subclass*)|(joined-subclass*))
41 <!ATTLIST class name CDATA #REQUIRED>
42 <!ATTLIST class table CDATA #IMPLIED> <!-- default: unqualified classname -->
43 <!ATTLIST class schema CDATA #IMPLIED> <!-- default: none -->
44 <!ATTLIST class proxy CDATA #IMPLIED> <!-- default: no proxy interface -->
45 <!ATTLIST class discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none -->
46 <!ATTLIST class mutable (true|false) "true">
47 <!ATTLIST class polymorphism (implicit|explicit) "implicit">
48 <!ATTLIST class where CDATA #IMPLIED> <!-- default: none -->
49 <!ATTLIST class persister CDATA #IMPLIED>
50 <!ATTLIST class dynamic-update (true|false) "false">
51 <!ATTLIST class dynamic-insert (true|false) "false">
52 <!ATTLIST class batch-size CDATA "1">
53 <!ATTLIST class select-before-update (true|false) "false">
54 <!ATTLIST class optimistic-lock (none|version|dirty|all) "version">
55 <!ATTLIST class lazy (true|false) #IMPLIED>
56 <!ATTLIST class check CDATA #IMPLIED> <!-- default: none -->
58 <!-- Declares the id type, column and generation algorithm for an entity class.
59 If a name attribut is given, the id is exposed to the application through the
60 named property of the class. If not, the id is only exposed to the application
61 via Session.getIdentifier() -->
63 <!ELEMENT id (meta*, column*, generator)>
64 <!ATTLIST id name CDATA #IMPLIED>
65 <!ATTLIST id access CDATA #IMPLIED>
66 <!ATTLIST id column CDATA #IMPLIED>
67 <!ATTLIST id type CDATA #IMPLIED>
68 <!ATTLIST id length CDATA #IMPLIED>
69 <!ATTLIST id unsaved-value CDATA "null"> <!-- any|none|null|0|-1|... -->
71 <!-- A composite key may be modelled by a java class with a property for each
72 key column. The class must implement java.io.Serializable and reimplement equals()
73 and hashCode(). -->
75 <!ELEMENT composite-id ( meta*, (key-property|key-many-to-one)+ )>
76 <!ATTLIST composite-id class CDATA #IMPLIED>
77 <!ATTLIST composite-id name CDATA #IMPLIED>
78 <!ATTLIST composite-id access CDATA #IMPLIED>
79 <!ATTLIST composite-id unsaved-value (any|none) "none">
81 <!-- Polymorphic data requires a column holding a class discriminator value. This
82 value is not directly exposed to the application. -->
84 <!ELEMENT discriminator (column?)>
85 <!ATTLIST discriminator column CDATA #IMPLIED> <!-- default: "class"|none -->
86 <!ATTLIST discriminator type CDATA "string">
87 <!ATTLIST discriminator not-null (true|false) "true">
88 <!ATTLIST discriminator length CDATA #IMPLIED>
89 <!ATTLIST discriminator force (true|false) "false">
90 <!ATTLIST discriminator insert (true|false) "true">
92 <!-- Versioned data requires a column holding a version number. This is exposed to the
93 application through a property of the Java class. -->
95 <!ELEMENT version (meta*)>
96 <!ATTLIST version name CDATA #REQUIRED>
97 <!ATTLIST version access CDATA #IMPLIED>
98 <!ATTLIST version column CDATA #IMPLIED>
99 <!ATTLIST version type CDATA "integer">
100 <!ATTLIST version unsaved-value (null|negative|undefined) "undefined">
102 <!ELEMENT timestamp (meta*)>
103 <!ATTLIST timestamp name CDATA #REQUIRED>
104 <!ATTLIST timestamp column CDATA #IMPLIED>
105 <!ATTLIST timestamp access CDATA #IMPLIED>
106 <!ATTLIST timestamp unsaved-value (null|undefined) "null">
108 <!-- Subclass declarations are nested beneath the root class declaration to achieve
109 polymorphic persistence. -->
111 <!ELEMENT subclass (
112 meta*,
113 (property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array)*,
114 subclass*
116 <!ATTLIST subclass name CDATA #REQUIRED>
117 <!ATTLIST subclass proxy CDATA #IMPLIED> <!-- default: no proxy interface -->
118 <!ATTLIST subclass discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none -->
119 <!ATTLIST subclass dynamic-update (true|false) "false">
120 <!ATTLIST subclass dynamic-insert (true|false) "false">
121 <!ATTLIST subclass select-before-update (true|false) "false">
122 <!ATTLIST subclass extends CDATA #IMPLIED> <!-- default: empty when a toplevel, otherwise the nearest class definition -->
123 <!ATTLIST subclass lazy (true|false) #IMPLIED>
124 <!ATTLIST subclass persister CDATA #IMPLIED>
126 <!-- Joined subclasses are used for the normalized table-per-subclass mapping strategy -->
128 <!ELEMENT joined-subclass (
129 meta*,
130 key,
131 (property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array)*,
132 joined-subclass*
134 <!ATTLIST joined-subclass name CDATA #REQUIRED>
135 <!ATTLIST joined-subclass proxy CDATA #IMPLIED> <!-- default: no proxy interface -->
136 <!ATTLIST joined-subclass table CDATA #IMPLIED> <!-- default: unqualified class name -->
137 <!ATTLIST joined-subclass schema CDATA #IMPLIED>
138 <!ATTLIST joined-subclass dynamic-update (true|false) "false">
139 <!ATTLIST joined-subclass dynamic-insert (true|false) "false">
140 <!ATTLIST joined-subclass select-before-update (true|false) "false">
141 <!ATTLIST joined-subclass extends CDATA #IMPLIED> <!-- default: empty when a toplevel, otherwise the nearest class definition -->
142 <!ATTLIST joined-subclass lazy (true|false) #IMPLIED>
143 <!ATTLIST joined-subclass persister CDATA #IMPLIED>
144 <!ATTLIST joined-subclass check CDATA #IMPLIED> <!-- default: none -->
146 <!-- Property of an entity class or component, component-element, composite-id, etc.
147 JavaBeans style properties are mapped to table columns. -->
149 <!ELEMENT property (meta*,column*)>
150 <!ATTLIST property name CDATA #REQUIRED>
151 <!ATTLIST property access CDATA #IMPLIED>
152 <!ATTLIST property type CDATA #IMPLIED>
153 <!ATTLIST property column CDATA #IMPLIED>
154 <!ATTLIST property length CDATA #IMPLIED>
155 <!ATTLIST property not-null (true|false) "false">
156 <!ATTLIST property unique (true|false) "false">
157 <!ATTLIST property update (true|false) "true"> <!-- only supported for properties of a class (not component) -->
158 <!ATTLIST property insert (true|false) "true"> <!-- only supported for properties of a class (not component) -->
159 <!ATTLIST property formula CDATA #IMPLIED> <!-- only supported for properties of a class (not component) -->
160 <!ATTLIST property index CDATA #IMPLIED> <!-- include the columns spanned by this property in an index -->
162 <!-- Declares an association between two entities (Or from a component, component element,
163 etc. to an entity). -->
165 <!ELEMENT many-to-one (meta*,column*)>
166 <!ATTLIST many-to-one name CDATA #REQUIRED>
167 <!ATTLIST many-to-one access CDATA #IMPLIED>
168 <!ATTLIST many-to-one class CDATA #IMPLIED>
169 <!ATTLIST many-to-one column CDATA #IMPLIED>
170 <!ATTLIST many-to-one not-null (true|false) "false">
171 <!ATTLIST many-to-one unique (true|false) "false">
172 <!ATTLIST many-to-one cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none -->
173 <!ATTLIST many-to-one outer-join (true|false|auto) "auto">
174 <!ATTLIST many-to-one update (true|false) "true"> <!-- only supported for many-to-one of a class (not component) -->
175 <!ATTLIST many-to-one insert (true|false) "true"> <!-- only supported for many-to-one of a class (not component) -->
176 <!ATTLIST many-to-one foreign-key CDATA #IMPLIED>
177 <!ATTLIST many-to-one property-ref CDATA #IMPLIED>
178 <!ATTLIST many-to-one index CDATA #IMPLIED> <!-- include the columns spanned by this association in an index -->
180 <!-- Declares a one-to-one association between two entities (Or from a component,
181 component element, etc. to an entity). -->
183 <!ELEMENT one-to-one (meta*)>
184 <!ATTLIST one-to-one name CDATA #REQUIRED>
185 <!ATTLIST one-to-one access CDATA #IMPLIED>
186 <!ATTLIST one-to-one class CDATA #IMPLIED>
187 <!ATTLIST one-to-one cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none -->
188 <!ATTLIST one-to-one outer-join (true|false|auto) "auto">
189 <!ATTLIST one-to-one constrained (true|false) "false">
190 <!ATTLIST one-to-one foreign-key CDATA #IMPLIED>
191 <!ATTLIST one-to-one property-ref CDATA #IMPLIED>
193 <!-- A property embedded in a composite identifier or map index (always not-null). -->
195 <!ELEMENT key-property (meta*,column*)>
196 <!ATTLIST key-property name CDATA #REQUIRED>
197 <!ATTLIST key-property access CDATA #IMPLIED>
198 <!ATTLIST key-property type CDATA #IMPLIED>
199 <!ATTLIST key-property column CDATA #IMPLIED>
200 <!ATTLIST key-property length CDATA #IMPLIED>
202 <!-- A many-to-one association embedded in a composite identifier or map index
203 (always not-null, never cascade). -->
205 <!ELEMENT key-many-to-one (meta*,column*)>
206 <!ATTLIST key-many-to-one name CDATA #REQUIRED>
207 <!ATTLIST key-many-to-one access CDATA #IMPLIED>
208 <!ATTLIST key-many-to-one class CDATA #IMPLIED>
209 <!ATTLIST key-many-to-one column CDATA #IMPLIED>
210 <!ATTLIST key-many-to-one foreign-key CDATA #IMPLIED>
212 <!-- An "any" association is a polymorphic association to any table with
213 the given identifier type. The first listed column is a VARCHAR column
214 holding the name of the class (for that row). -->
216 <!ELEMENT any (meta*,meta-value*,column,column+)>
217 <!ATTLIST any id-type CDATA #REQUIRED>
218 <!ATTLIST any meta-type CDATA #IMPLIED> <!--- default: Hibernate.CLASS -->
219 <!ATTLIST any name CDATA #REQUIRED>
220 <!ATTLIST any access CDATA #IMPLIED>
221 <!ATTLIST any insert (true|false) "true"> <!-- only supported for many-to-one of a class (not component) -->
222 <!ATTLIST any update (true|false) "true"> <!-- only supported for many-to-one of a class (not component) -->
223 <!ATTLIST any cascade (none|save-update|all) "none">
224 <!ATTLIST any index CDATA #IMPLIED> <!-- include the columns spanned by this association in an index -->
226 <!ELEMENT meta-value EMPTY>
227 <!ATTLIST meta-value value CDATA #REQUIRED>
228 <!ATTLIST meta-value class CDATA #REQUIRED>
230 <!-- A component is a user-defined class, persisted along with its containing entity
231 to the table of the entity class. JavaBeans style properties of the component are
232 mapped to columns of the table of the containing entity. A null component reference
233 is mapped to null values in all columns and vice versa. Components do not support
234 shared reference semantics. -->
236 <!ELEMENT component (
237 meta*,
238 parent?,
239 (property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|array|primitive-array)*
241 <!ATTLIST component class CDATA #IMPLIED>
242 <!ATTLIST component name CDATA #REQUIRED>
243 <!ATTLIST component access CDATA #IMPLIED>
244 <!ATTLIST component update (true|false) "true">
245 <!ATTLIST component insert (true|false) "true">
247 <!ELEMENT dynamic-component (
248 (property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|array|primitive-array)*
250 <!ATTLIST dynamic-component name CDATA #REQUIRED>
251 <!ATTLIST dynamic-component access CDATA #IMPLIED>
252 <!ATTLIST dynamic-component update (true|false) "true">
253 <!ATTLIST dynamic-component insert (true|false) "true">
255 <!-- The parent element maps a property of the component class as a pointer back to
256 the owning entity. -->
258 <!ELEMENT parent EMPTY>
259 <!ATTLIST parent name CDATA #REQUIRED>
261 <!-- Collection declarations nested inside a class declaration indicate a foreign key
262 relationship from the collection table to the enclosing class. -->
264 <!ELEMENT map (
265 meta*,
266 (cache|jcs-cache)?,
267 key,
268 (index|composite-index|index-many-to-many|index-many-to-any),
269 (element|one-to-many|many-to-many|composite-element|many-to-any)
271 <!ATTLIST map name CDATA #REQUIRED>
272 <!ATTLIST map access CDATA #IMPLIED>
273 <!ATTLIST map table CDATA #IMPLIED> <!-- default: name -->
274 <!ATTLIST map schema CDATA #IMPLIED> <!-- default: none -->
275 <!ATTLIST map lazy (true|false) "false">
276 <!ATTLIST map inverse (true|false) "false">
277 <!ATTLIST map sort CDATA "unsorted"> <!-- unsorted|natural|"comparator class", default: unsorted -->
278 <!ATTLIST map cascade (none|all|save-update|delete|all-delete-orphan|delete-orphan) #IMPLIED> <!-- default: none -->
279 <!ATTLIST map order-by CDATA #IMPLIED> <!-- default: none -->
280 <!ATTLIST map where CDATA #IMPLIED> <!-- default: none -->
281 <!ATTLIST map batch-size CDATA "1">
282 <!ATTLIST map outer-join (true|false|auto) "auto">
283 <!ATTLIST map check CDATA #IMPLIED> <!-- default: none -->
284 <!ATTLIST map persister CDATA #IMPLIED>
286 <!ELEMENT set (
287 meta*,
288 (cache|jcs-cache)?,
289 key,
290 (element|one-to-many|many-to-many|composite-element|many-to-any)
292 <!ATTLIST set name CDATA #REQUIRED>
293 <!ATTLIST set access CDATA #IMPLIED>
294 <!ATTLIST set table CDATA #IMPLIED> <!-- default: name -->
295 <!ATTLIST set schema CDATA #IMPLIED> <!-- default: none -->
296 <!ATTLIST set lazy (true|false) "false">
297 <!ATTLIST set sort CDATA "unsorted"> <!-- unsorted|natural|"comparator class" -->
298 <!ATTLIST set inverse (true|false) "false">
299 <!ATTLIST set cascade (none|all|save-update|delete|all-delete-orphan|delete-orphan) #IMPLIED> <!-- default: none -->
300 <!ATTLIST set order-by CDATA #IMPLIED> <!-- default: none -->
301 <!ATTLIST set where CDATA #IMPLIED> <!-- default: none -->
302 <!ATTLIST set batch-size CDATA "1">
303 <!ATTLIST set outer-join (true|false|auto) "auto">
304 <!ATTLIST set persister CDATA #IMPLIED>
305 <!ATTLIST set check CDATA #IMPLIED> <!-- default: none -->
307 <!ELEMENT bag (
308 meta*,
309 (cache|jcs-cache)?,
310 key,
311 (element|one-to-many|many-to-many|composite-element|many-to-any)
313 <!ATTLIST bag name CDATA #REQUIRED>
314 <!ATTLIST bag access CDATA #IMPLIED>
315 <!ATTLIST bag table CDATA #IMPLIED> <!-- default: name -->
316 <!ATTLIST bag schema CDATA #IMPLIED> <!-- default: none -->
317 <!ATTLIST bag lazy (true|false) "false">
318 <!ATTLIST bag inverse (true|false) "false">
319 <!ATTLIST bag cascade (none|all|save-update|delete|all-delete-orphan|delete-orphan) #IMPLIED> <!-- default: none -->
320 <!ATTLIST bag order-by CDATA #IMPLIED> <!-- default: none -->
321 <!ATTLIST bag where CDATA #IMPLIED> <!-- default: none -->
322 <!ATTLIST bag batch-size CDATA "1">
323 <!ATTLIST bag outer-join (true|false|auto) "auto">
324 <!ATTLIST bag persister CDATA #IMPLIED>
325 <!ATTLIST bag check CDATA #IMPLIED> <!-- default: none -->
327 <!ELEMENT idbag (
328 meta*,
329 (cache|jcs-cache)?,
330 collection-id,
331 key,
332 (element|many-to-many|composite-element|many-to-any)
334 <!ATTLIST idbag name CDATA #REQUIRED>
335 <!ATTLIST idbag access CDATA #IMPLIED>
336 <!ATTLIST idbag table CDATA #IMPLIED> <!-- default: name -->
337 <!ATTLIST idbag schema CDATA #IMPLIED> <!-- default: none -->
338 <!ATTLIST idbag lazy (true|false) "false">
339 <!ATTLIST idbag cascade (none|all|save-update|delete|all-delete-orphan|delete-orphan) #IMPLIED> <!-- default: none -->
340 <!ATTLIST idbag order-by CDATA #IMPLIED> <!-- default: none -->
341 <!ATTLIST idbag where CDATA #IMPLIED> <!-- default: none -->
342 <!ATTLIST idbag batch-size CDATA "1">
343 <!ATTLIST idbag outer-join (true|false|auto) "auto">
344 <!ATTLIST idbag persister CDATA #IMPLIED>
345 <!ATTLIST idbag check CDATA #IMPLIED> <!-- default: none -->
347 <!ELEMENT list (
348 meta*,
349 (cache|jcs-cache)?,
350 key,
351 index,
352 (element|one-to-many|many-to-many|composite-element|many-to-any)
354 <!ATTLIST list name CDATA #REQUIRED>
355 <!ATTLIST list access CDATA #IMPLIED>
356 <!ATTLIST list table CDATA #IMPLIED> <!-- default: name -->
357 <!ATTLIST list schema CDATA #IMPLIED> <!-- default: none -->
358 <!ATTLIST list lazy (true|false) "false">
359 <!ATTLIST list inverse (true|false) "false">
360 <!ATTLIST list cascade (none|all|save-update|delete|all-delete-orphan|delete-orphan) #IMPLIED> <!-- default: none -->
361 <!ATTLIST list where CDATA #IMPLIED> <!-- default: none -->
362 <!ATTLIST list batch-size CDATA "1">
363 <!ATTLIST list outer-join (true|false|auto) "auto">
364 <!ATTLIST list persister CDATA #IMPLIED>
365 <!ATTLIST list check CDATA #IMPLIED> <!-- default: none -->
367 <!ELEMENT array (
368 meta*,
369 (cache|jcs-cache)?,
370 key,
371 index,
372 (element|one-to-many|many-to-many|composite-element|many-to-any)
374 <!ATTLIST array name CDATA #REQUIRED>
375 <!ATTLIST array access CDATA #IMPLIED>
376 <!ATTLIST array table CDATA #IMPLIED> <!-- default: name -->
377 <!ATTLIST array schema CDATA #IMPLIED> <!-- default: none -->
378 <!ATTLIST array inverse (true|false) "false">
379 <!ATTLIST array element-class CDATA #IMPLIED>
380 <!ATTLIST array cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none -->
381 <!ATTLIST array where CDATA #IMPLIED> <!-- default: none -->
382 <!ATTLIST array batch-size CDATA "1">
383 <!ATTLIST array outer-join (true|false|auto) "auto">
384 <!ATTLIST array persister CDATA #IMPLIED>
385 <!ATTLIST array check CDATA #IMPLIED> <!-- default: none -->
387 <!ELEMENT primitive-array (meta*, (cache|jcs-cache)?, key, index, element)>
388 <!ATTLIST primitive-array name CDATA #REQUIRED>
389 <!ATTLIST primitive-array access CDATA #IMPLIED>
390 <!ATTLIST primitive-array table CDATA #IMPLIED> <!-- default: name -->
391 <!ATTLIST primitive-array schema CDATA #IMPLIED> <!-- default: none -->
392 <!ATTLIST primitive-array where CDATA #IMPLIED> <!-- default: none -->
393 <!ATTLIST primitive-array batch-size CDATA "1">
394 <!ATTLIST primitive-array outer-join (true|false|auto) "auto">
395 <!ATTLIST primitive-array persister CDATA #IMPLIED>
396 <!ATTLIST primitive-array check CDATA #IMPLIED> <!-- default: none -->
398 <!-- Declares the element type of a collection of basic type -->
400 <!ELEMENT element (column*)>
401 <!ATTLIST element column CDATA #IMPLIED>
402 <!ATTLIST element type CDATA #REQUIRED>
403 <!ATTLIST element length CDATA #IMPLIED>
404 <!ATTLIST element not-null (true|false) "false">
405 <!ATTLIST element unique (true|false) "false">
407 <!-- One to many association. This tag declares the entity-class
408 element type of a collection and specifies a one-to-many relational model -->
410 <!ELEMENT one-to-many EMPTY>
411 <!ATTLIST one-to-many class CDATA #REQUIRED>
412 <!-- No column declaration attributes required in this case. The primary
413 key column of the associated class is already mapped elsewhere.-->
415 <!-- Many to many association. This tag declares the entity-class
416 element type of a collection and specifies a many-to-many relational model -->
418 <!ELEMENT many-to-many (meta*,column*)>
419 <!ATTLIST many-to-many class CDATA #REQUIRED>
420 <!ATTLIST many-to-many column CDATA #IMPLIED>
421 <!ATTLIST many-to-many outer-join (true|false|auto) "auto">
422 <!ATTLIST many-to-many foreign-key CDATA #IMPLIED>
423 <!-- unique makes no sense here since it would make the association one-to-many -->
425 <!-- A composite element allows a collection to hold instances of an arbitrary
426 class, without the requirement of joining to an entity table. Composite elements
427 have component semantics - no shared references and ad hoc null value semantics.
428 Composite elements may not hold nested collections. -->
430 <!ELEMENT composite-element (
431 (meta*),
432 parent?,
433 (property|many-to-one|any|nested-composite-element)*
435 <!ATTLIST composite-element class CDATA #REQUIRED>
437 <!ELEMENT nested-composite-element (
438 (meta*),
439 parent?,
440 (property|many-to-one|any|nested-composite-element)*
442 <!ATTLIST nested-composite-element class CDATA #REQUIRED>
443 <!ATTLIST nested-composite-element name CDATA #REQUIRED>
444 <!ATTLIST nested-composite-element access CDATA #IMPLIED>
446 <!-- Declares the column name of a foreign key. -->
448 <!ELEMENT key (column*)>
449 <!ATTLIST key column CDATA #IMPLIED>
450 <!ATTLIST key foreign-key CDATA #IMPLIED>
452 <!-- Declares the type and column mapping for a collection index (array or
453 list index, or key of a map). -->
455 <!ELEMENT index (column*)>
456 <!ATTLIST index column CDATA #IMPLIED>
457 <!ATTLIST index type CDATA #IMPLIED> <!-- required for maps -->
458 <!ATTLIST index length CDATA #IMPLIED>
460 <!-- Many to many association mapped to the key of a map. ie. a map keyed
461 on entities. -->
463 <!ELEMENT index-many-to-many (column*)>
464 <!ATTLIST index-many-to-many class CDATA #REQUIRED>
465 <!ATTLIST index-many-to-many column CDATA #IMPLIED>
466 <!ATTLIST index-many-to-many foreign-key CDATA #IMPLIED>
468 <!-- Composite index of a map ie. a map keyed on components. -->
470 <!ELEMENT composite-index ( (key-property|key-many-to-one)+ )>
471 <!ATTLIST composite-index class CDATA #REQUIRED>
473 <!-- A "many to any" defines a polymorphic association to any table
474 with the given identifier type. The first listed column is a VARCHAR column
475 holding the name of the class (for that row). -->
477 <!ELEMENT many-to-any (meta-value*,column, column+)>
478 <!ATTLIST many-to-any id-type CDATA #REQUIRED>
479 <!ATTLIST many-to-any meta-type CDATA #IMPLIED> <!--- default: Hibernate.CLASS -->
481 <!ELEMENT index-many-to-any (column, column+)>
482 <!ATTLIST index-many-to-any id-type CDATA #REQUIRED>
483 <!ATTLIST index-many-to-any meta-type CDATA #IMPLIED> <!--- default: Hibernate.CLASS -->
485 <!ELEMENT collection-id (meta*, column*, generator)>
486 <!ATTLIST collection-id column CDATA #REQUIRED>
487 <!ATTLIST collection-id type CDATA #REQUIRED>
488 <!ATTLIST collection-id length CDATA #IMPLIED>
490 <!-- Generators generate unique identifiers. The class attribute specifies a Java
491 class implementing an id generation algorithm. -->
493 <!ELEMENT generator (param*)>
494 <!ATTLIST generator class CDATA #REQUIRED>
495 <!ELEMENT param (#PCDATA)>
496 <!ATTLIST param name CDATA #REQUIRED>
498 <!-- The column element is an alternative to column attributes and required for
499 mapping associations to classes with composite ids. -->
501 <!ELEMENT column EMPTY>
502 <!ATTLIST column name CDATA #REQUIRED>
503 <!ATTLIST column length CDATA #IMPLIED> <!-- default: 255 -->
504 <!ATTLIST column not-null (true|false) #IMPLIED> <!-- default: false (except for id properties) -->
505 <!ATTLIST column unique (true|false) #IMPLIED> <!-- default: false (except for id properties) -->
506 <!ATTLIST column unique-key CDATA #IMPLIED> <!-- default: no unique key -->
507 <!ATTLIST column sql-type CDATA #IMPLIED> <!-- override default column type for hibernate type -->
508 <!ATTLIST column index CDATA #IMPLIED>
509 <!ATTLIST column check CDATA #IMPLIED> <!-- default: none -->
511 <!-- The cache or jcs-cache element enables caching of an entity class. -->
512 <!ELEMENT cache EMPTY>
513 <!ATTLIST cache usage (read-only|read-write|nonstrict-read-write|transactional) #REQUIRED>
514 <!ELEMENT jcs-cache EMPTY>
515 <!ATTLIST jcs-cache usage (read-only|read-write|nonstrict-read-write|transactional) #REQUIRED> <!-- deprecated -->
517 <!-- The query element declares a named Hibernate query string -->
519 <!ELEMENT query (#PCDATA)>
520 <!ATTLIST query name CDATA #REQUIRED>
522 <!-- The sql-query element declares a named SQL query string -->
524 <!ELEMENT return EMPTY>
525 <!ATTLIST return alias CDATA #REQUIRED>
526 <!ATTLIST return class CDATA #REQUIRED>
528 <!ELEMENT synchronize EMPTY>
529 <!ATTLIST synchronize table CDATA #REQUIRED>
531 <!ELEMENT sql-query (#PCDATA|return|synchronize)*>
532 <!ATTLIST sql-query name CDATA #REQUIRED>
535 <!-- The meta element is used to assign meta-level attributes to a class or property.
536 Is currently used by codegenerator as a placeholder for values that is not directly
537 related to OR mappings. -->
539 <!ELEMENT meta (#PCDATA)>
540 <!ATTLIST meta attribute CDATA #REQUIRED>
541 <!ATTLIST meta inherit (true|false) "true">