0

I want to use lazy="true" in hibernate while loading detail using Jersey in JAVA. But I getting error. (hbm version 5.1.3.Final)

Here is my code:

 <class name="com.icaube.application.prac.details.PracAccountDetail" table="prac_account_master">
    <id column="account_id" name="accountId">
        <generator class="com.icube.platform.IdGenerator">
            <param name="componentName">PracAccount</param>
        </generator>
    </id>

//here lazy=true     
<many-to-one name="pracRankDetail" class="com.icaube.application.prac.details.PracRankDetail" column="rank_id" lazy="true"/>  

<one-to-one name="pracAddressDetail" property-ref="accountId" lazy="false"  />

<property column="name" name="name"  not-null="true" unique="false"/>

    <property column="rank_id" name="rankId"  not-null="true" unique="false"/>
</class>

Getting ERROR: Initial SessionFactory creation failed.org.hibernate.boot.InvalidMappingEelloxception: Could not parse mapping document: PracComponents.hbm.xml (RESOURCE)

What is wrong in this? How can I make it correct?

Thanks :-)

unknownbits
  • 2,855
  • 10
  • 41
  • 81

2 Answers2

0

you class tag

<class name="com.icaube.application.prac.details.PracAccountDetail" table="prac_account_master">

is not being closed or you did not post everything in your xml file.

Marcus Lanvers
  • 383
  • 5
  • 20
0

The error Could not parse mapping document is about your xml files not being well-formed. When this error comes up, we'd better double check our xml files to see if they are really OK (all tags are properly closed and so on).

To know more refer below links :

org.hibernate.InvalidMappingException: Could not parse mapping document from resource *.hbm.xml

https://coderanch.com/t/217940/databases/Hibernate-InvalidMappingException-parse-mapping-document

Ramesh Fadatare
  • 561
  • 4
  • 12