On 16 Dec 2003 20:28, craigduncan wrote:
>In the example hibernatedoclet task near the top of this post you are
>copying some files to the ${build.resources}/sar/hibernate directory.
>What are the hibernate-properties-*.xml files for? It looks like most
>of the hibernate properties are set in the jboss-service.xml, so I was
>wondering what these files are for?
There are some parts of a Hibernate hbm.xml file that cannot be
generated from XDoclet hibernatedoclet @tags in your source with XDoclet
1.2.b4. In my case, I needed to include:
<!-- Included by Hibernate XDoclet task into the hbm.xml -->
<any name="referredToObject" id-type="long">
<column name="objectClass" length="128" not-null="true"/>
<column name="objectId" not-null="true"/>
</any>
in one of my class mappings. So in my source tree I have:
com/galenworks/hibernate/DocumentCrossReference.java
com/galenworks/hibernate/hibernate-properties-DocumentCrossReference.xml
The hibernate-properties-DocumentCrossReference.xml contains the needed
snippet. Doing the copy of this file into
${build.resources}/sar/hibernate/com/galenworks/hibernate and then
running hibernatedoclet includes the snippet at the end of the class
tag, ie.
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="com.galenworks.procedurelink.hibernate.DocumentCrossReference"
table="DocumentXref"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="documentXrefId"
column="documentXrefId"
type="long"
>
<generator class="sequence">
<param name="sequence">documentXrefSeq</param>
</generator>
</id>
<property
name="documentXPath"
type="string"
update="true"
insert="true"
column="documentXPath"
length="255"
not-null="true"
/>
[snip]
<!-- Included by Hibernate XDoclet task into the hbm.xml -->
<any name="referredToObject" id-type="long">
<column name="objectClass" length="128" not-null="true"/>
<column name="objectId" not-null="true"/>
</any>
</class>
</hibernate-mapping>
>Also, your example copies a jboss-service-custom.xml file. Should that
>be a jboss-service-custom.xdt file? I read the other posts about the
>problem with the xdt provided with the 1.2.b4 release of xdoclet, but I
>am still a little confused.
You are right - it should be "jboss-service-custom.xdt". I'll update the
wiki page. |