Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1374

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XDT-1374
    Summary: incorrectly adding lazy="false" to <component> under hibernate 2.0
       Type: Bug

     Status: Open
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: XDoclet
 Components: 
             Hibernate Module
   Versions:
             1.3

   Assignee: xdoclet-devel (Use for new issues)
   Reporter: Nathan Egge

    Created: Thu, 28 Apr 2005 11:18 PM
    Updated: Thu, 28 Apr 2005 11:18 PM
Environment: Gentoo Linux x86/2005.0/2.4
[blackdown-jdk-1.4.2] "Blackdown JDK 1.4.2"

Description:
When building hibernate mappings under XDoclet 1.3-SNAPSHOT using the following 
ant task:

  <target name="hibernatedoclet" depends="init">
    <hibernatedoclet
        destdir="${build.dir}/domain/hibernate">
      <fileset dir="${src.dir}/domain">
        <include name="**/model/*.java"/>
      </fileset>
      <hibernate validatexml="true" version="2.0"/>
    </hibernatedoclet>
  </target>

I get the following exception:

[hibernatedoclet] xdoclet.XDocletException: Generated file [file:...] 
Message=[Attribute "lazy" is not declared for element "component".] is not 
valid according to its DTD or XML Schema. This might be due to some missing 
tags in your source.

Looking at the hibernate-properties.xdt there is the following definition for 
the <component>

        <component
            name="<XDtMethod:propertyName />"
            class="<XDtMethod:methodTagValue tagName="hibernate.component" 
paramName="class" default="<XDtMethod>
            lazy="<XDtMethod:methodTagValue tagName="hibernate.component" 
paramName="lazy" default="false"/>"
        >

However, the hibernate-mapping_2_0.dtd does not include a lazy attribute on 
<component> so when the xml is validated, it fails.  One solution might be to 
wrap the lazy=... line in a conditional based on the hibernate version.  This 
has has some limitations since who knows what will be done in future versions 
of hibernate.

Alternately, we could simply wrap the the lazy=... line in a conditional based 
on the existance of the lazy method tag:

            <XDtMethod:ifHasMethodTag tagName="hibernate.component" 
paramName="lazy">
            lazy="<XDtMethod:methodTagValue tagName="hibernate.component" 
paramName="lazy"/>"
            </XDtMethod:ifHasMethodTag>

This seems like the right solution.  I will create a patch and attach it to 
this issue.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to