Hello,

I have a problem with Xdoclet2 generating a simple hibernate class. If I turn off the xml validation, then the resulting code fails during runtime. I have tried using the latest xdoclet2 and hibernate 3.1 jars. I understand the the update statement looks wierd, but please ignore that. Here is the relevant ant and hbm.xml code:

build.xml
----------------------------
<!-- generate Hibernate mappings -->
<target name="gen-hibernate" description="XDoclet Generate Hibernate mappings">

   <taskdef name="hibernatedoclet"
               classname="org.xdoclet.ant.XDocletTask"
       classpathref="xdoclet.path"
       />

   <hibernatedoclet>
      <fileset dir="./src">
          <include name="***/*.java"/>
      </fileset>
   <component
        classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin"
        destdir="${build.compile_beans}"
        version="3.0"
        validate="false"
      />
   </hibernatedoclet>
----------------------------



generated hbm.xml file
-----------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd";>

<hibernate-mapping>
<class table="album_audioFile_bridge" name="org.company.pojos.AudioPriorityData">
   <id column="dummy_id" unsaved-value="null" name="id">
     <generator class="uuid.hex"/>
   </id>
   <property name="id2" column="dummy_id2"/>
   <property name="priority" column="priority" unique="false"/>
   <property name="audioFileId" column="audio_file_id" unique="false"/>
   <property name="albumId" column="albumId" unique="false"/>
<sql-insert>UPDATE albumep_audioFile_bridge SET dummy_id=?, priority=? WHERE audio_file_id=? AND album_id=? AND album_id<>?</sql-insert>
 </class>
</hibernate-mapping>
---------------------------


ant output (with validation="true")
-------------------------------
[hibernatedoclet] File /d:/src/./build/compile_beans/org/company/pojos/AudioPriorityData.hbm.xml did not pass validation: ParsingFailed Error on line 13 of document : The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.

BUILD FAILED
D:\src\build.xml:135: org.generama.OutputValidationError: ParsingFailed Error on line 13 of document : The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.
------------------------------------

-Mark

Reply via email to