The problem:
=========
1. The DTD for the SET element doesn't include the "name" attribute
2. All of the examples for Hib 2.1.6 include a name attribute however
3. The code expects (and poorly catches if not present - eg NPE's) a name attribute for all collections. (I've checked out and fixed the code to report this better - patch available if required)
If it validates against the DTD (validation is on by default) then your code will break. If you leave out the name attribute then your code will break.
XDoclet generates the doctype (and hence the DTD specifier by default)...
Rock [ me ] Hard place...
:)
Thoughts very welcome - in the meantime I'm running with my modified jar.
Attachments
========
The DTD for SET is as follows (from
http://hibernate.sourceforge.net/hibern ... ng-1.1.dtd)
<!ELEMENT set (
jcs-cache?,
(key|generated-key),
(element|one-to-many|many-to-many|subcollection|composite-element)
)>
<!ATTLIST set role CDATA #REQUIRED>
<!ATTLIST set table CDATA #IMPLIED> <!-- default: rolename -->
<!ATTLIST set schema CDATA #IMPLIED> <!-- default: none -->
<!ATTLIST set lazy (true|false) "false">
<!ATTLIST set sort CDATA "unsorted"> <!-- unsorted|natural|"comparator class" -->
<!ATTLIST set readonly (true|false) "false">
<!ATTLIST set cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none -->
<!ATTLIST set order-by CDATA #IMPLIED> <!-- default: none -->
An example of the usage of "set" is:
=======================
<set name="subDetails" lazy="true" cascade="all">
<key column="detail_key"/>
<one-to-many class="org.hibernate.test.SubDetail"/>
</set>
(MasterDetail.hbm.xml)
-- Note the name attribute