有啊,只不过默认不是lazy而已啊

解决方案 »

  1.   


    <!ELEMENT many-to-one (meta*,column*)>
      <!ATTLIST many-to-one name CDATA #REQUIRED>
      <!ATTLIST many-to-one access CDATA #IMPLIED>
      <!ATTLIST many-to-one class CDATA #IMPLIED>
      <!ATTLIST many-to-one column CDATA #IMPLIED>
      <!ATTLIST many-to-one not-null (true|false) "false">
      <!ATTLIST many-to-one unique (true|false) "false">
      <!ATTLIST many-to-one cascade (none|all|save-update|delete) #IMPLIED>    <!-- default: none -->
      <!ATTLIST many-to-one outer-join (true|false|auto) "auto">
      <!ATTLIST many-to-one update (true|false) "true">   <!-- only supported for many-to-one of a class (not component) -->
      <!ATTLIST many-to-one insert (true|false) "true">   <!-- only supported for many-to-one of a class (not component) -->
      <!ATTLIST many-to-one foreign-key CDATA #IMPLIED>
      <!ATTLIST many-to-one property-ref CDATA #IMPLIED>
      <!ATTLIST many-to-one index CDATA #IMPLIED>         <!-- include the columns spanned by this association in an index -->
        
    <!-- Declares a one-to-one association between two entities (Or from a component, 
    component element, etc. to an entity). --><!ELEMENT one-to-one (meta*)>
      <!ATTLIST one-to-one name CDATA #REQUIRED>
      <!ATTLIST one-to-one access CDATA #IMPLIED>
      <!ATTLIST one-to-one class CDATA #IMPLIED>
      <!ATTLIST one-to-one cascade (none|all|save-update|delete) #IMPLIED>     <!-- default: none -->
      <!ATTLIST one-to-one outer-join (true|false|auto) "auto">
      <!ATTLIST one-to-one constrained (true|false) "false">
      <!ATTLIST one-to-one foreign-key CDATA #IMPLIED>
      <!ATTLIST one-to-one property-ref CDATA #IMPLIED>2.0的DTD中没有lazy属性  项目用的是 hibernate2.0的
      

  2.   

    看了下Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.2
    Created-By: 1.4.2_06-b03 (Sun Microsystems Inc.)
    Hibernate-Version: 2.1.7
      

  3.   


    报错  DTD定死的 。。  看了书说constrained="true"  outer-join= false   然后关联表class 上 lazy=true
    依旧失败。。
      

  4.   

    不记得这么复杂,就是一个lazy=true就搞定了,贴出hbm文件看看
      

  5.   

    @ManyToOne(fetch = FetchType.LAZY)