-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Urgently Needed: Data not Loading in the Grand Child Table
PostPosted: Wed Jan 28, 2009 12:39 pm 
Newbie

Joined: Wed Jan 28, 2009 11:42 am
Posts: 2
Immediate Response would be appreciated

Quote:
Hibernate version used: 2.1

Database Used : Oracle 10


Quote:


Did any one come across the issue?
Trying to load the data from three tables :
    Loan, Applicant, ApplicantDependent

Data is loading into Loan and Applicant but not in ApplicantDependent.

Below are details

Code:

Public class Loan {

private String iLoanID;
private long iLoanNo;
....
....
private Collection iApplicantCollection;

//Constructors
......
//Setters n Getters

}


Public class Applicant {

private String iLoanID;
private String iApplicantID;
private String iApplicantName;
....
....
private Collection iApplicantDependentCollection;

//Constructors
......
//Setters n Getters

}


Public class ApplicantDependent {

private String iLoanID;
private String iApplicantID;
private String iApplicantDependentID;
private String iApplicantDependentName;
....
//Constructors
......
//Setters n Getters

}

//Created for Composite ID's in mapping
Public class ApplicantID {

private String iLoanID;
private String iApplicantID;
....
//Constructors
......
//Setters n Getters

}

Public class ApplicantDependentID {

private String iLoanID;
private String iApplicantID;
private String iApplicantDependentID;
....
//Constructors
......
//Setters n Getters

}

//mapping files
[i]loan.hbm.xml[/i]

<class name="Loan" table="LOAN" dynamic-insert="true" dynamic-update="true">

  <id name="loanId" type="string" unsaved-value="any">
        <column name="LOANID"/>
        <generator class="assigned">
  </id>

<property name="loanNo" />
...........

<bag name="applicantCollection" table="APPLICANT" cascade="all" lazy="true" inverse="true">

          <key>
                  <column name="LOANID" not-null="true"/>
          </key>
          <one-to-many class="Applicant"/>
</bag>
</class>
[i]applicant.hbm.xml[/i]

<class name="Applicant" table="APPLICANT" dynamic-insert="true" dynamic-update="true">

  <composite-id class="ApplicantID" >
       <key-property name="loanID" />     
       <key-property name="applicantID" />

  </composite-id>

<property name="applicantName" />
...........

<bag name="applicantDependentCollection" table="APPLICANTDEPENDENT" cascade="all" lazy="true" inverse="true">

          <key>
                  <column name="LOANID" not-null="true"/>
                  <column name="APPLICANTID" not-null="true"/>
          </key>
          <one-to-many class="ApplicantDependent"/>
</bag>

<many-to-one class="Loan">
        <key>
                  <column name="LOANID" not-null="true"/>
                 
          </key>

</many-to-one>

</class>

[i]applicantdependent.hbm.xml[/i]

<class name="ApplicantDependent" table="APPLICANTDEPENDENT" dynamic-insert="true" dynamic-update="true">

  <composite-id class="ApplicantDependentID" >
       <key-property name="loanID" />     
       <key-property name="applicantID" />
       <key-property name="applicantDependentID" />
  </composite-id>

<property name="applicantDependentName" />
...........
...........

<many-to-one class="Applicant">
          <key>
                  <column name="LOANID" not-null="true"/>
                  <column name="APPLICANTID" not-null="true"/>

          </key>

</many-to-one>

</class>




[/quote]

_________________
StarTeam


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.