-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to get all the Children of parent Object in Hibernate
PostPosted: Wed Feb 06, 2008 7:04 am 
Newbie

Joined: Wed Feb 06, 2008 6:55 am
Posts: 2
hi all

I have a doubt . How can we get all the children from a hibernate object.
I want to check any child object is assossiated with the given object
If not I want to make some updations on that Object.Is there is any general solution for this

thanking you

Rajesh


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 8:00 am 
Regular
Regular

Joined: Mon Aug 20, 2007 6:47 am
Posts: 74
Location: UK
Yes this can easily be done, but you will need to be more specific about your problem and preferably post some code/hibernate mappings/database schemas if you want a clear answer that can help you.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 8:37 am 
Newbie

Joined: Wed Feb 06, 2008 6:55 am
Posts: 2
hi

Thanks for your reply.Here is our hbm.xml file of "Institution" table.
I want to get all the child table in "institution" as a Collection.

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Nov 29, 2007 3:56:04 PM by Hibernate Tools 3.1.0 beta1JBIDERC2 -->
<hibernate-mapping>
<class name="com.amritatech.aums.hibernate.Institution" table="institution" where="Status='v'">
<id name="id" type="integer">
<column name="ID" />
<generator class="org.amma.aitf.hmoscore.services.HibernateIDGenerator" />
</id>
<many-to-one name="countryMaster" class="com.amritatech.aums.hibernate.CountryMaster" fetch="select">
<column name="CountryID" />
</many-to-one>
<many-to-one name="siteMaster" class="com.amritatech.aums.hibernate.SiteMaster" fetch="select">
<column name="SiteMasterID" not-null="true" />
</many-to-one>
<many-to-one name="stateMaster" class="com.amritatech.aums.hibernate.StateMaster" fetch="select">
<column name="StateID" />
</many-to-one>
<property name="name" type="string">
<column name="Name" length="250" not-null="true" />
</property>
<property name="shortName" type="string">
<column name="ShortName" length="250" />
</property>
<property name="headId" type="integer">
<column name="HeadID" />
</property>
<property name="addressLine1" type="string">
<column name="AddressLine1" length="250" />
</property>
<property name="addressLine2" type="string">
<column name="AddressLine2" length="250" />
</property>
<property name="location" type="string">
<column name="Location" length="250" />
</property>
<property name="city" type="string">
<column name="City" length="250" />
</property>
<property name="pincode" type="string">
<column name="PINCode" length="30" />
</property>
<property name="phone" type="string">
<column name="Phone" length="30" />
</property>
<property name="versionNo" type="integer">
<column name="VersionNo" />
</property>
<property name="createdBy" type="string">
<column name="CreatedBy" length="10" />
</property>
<property name="createdDate" type="timestamp">
<column name="CreatedDate" length="19" />
</property>
<property name="modifiedBy" type="string">
<column name="ModifiedBy" length="10" />
</property>
<property name="modifiedDate" type="timestamp">
<column name="ModifiedDate" length="19" />
</property>
<property name="status" type="character">
<column name="Status" length="1" />
</property>
<set name="evaluationSubComponentMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.EvaluationSubComponentMaster" />
</set>
<set name="gradeSheetCounters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.GradeSheetCounter" />
</set>
<set name="libraryMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.LibraryMaster" />
</set>
<set name="certificateSignatories" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.CertificateSignatory" />
</set>
<set name="programTypeMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.ProgramTypeMaster" />
</set>
<set name="courseMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.CourseMaster" />
</set>
<set name="feeCategories" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.FeeCategory" />
</set>
<set name="departments" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.Department" />
</set>
<set name="academicPeriods" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.AcademicPeriod" />
</set>
<set name="institutionStepLabels" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.InstitutionStepLabel" />
</set>
<set name="gpaRuleMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.GpaRuleMaster" />
</set>
<set name="stepDateOfPassConfigs" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.StepDateOfPassConfig" />
</set>
<set name="venueMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.VenueMaster" />
</set>

<set name="designationMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.DesignationMaster" />
</set>
<set name="termPeriods" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.TermPeriod" />
</set>
<set name="roundingMethodMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.RoundingMethodMaster" />
</set>
<set name="personInstitutions" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.PersonInstitution" />
</set>
<set name="evaluationComponentTypeMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.EvaluationComponentTypeMaster" />
</set>
<set name="courseTypeMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.CourseTypeMaster" />
</set>
<set name="gradesheetDisplayPeriodMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.GradesheetDisplayPeriodMaster" />
</set>
<set name="evaluationComponentMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.EvaluationComponentMaster" />
</set>
<set name="sections" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.Section" />
</set>
<set name="libraryMembers" inverse="true">
<key>
<column name="MemberInstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.LibraryMember" />
</set>
<set name="programs" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.Program" />
</set>
<set name="certificateTypeses" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.CertificateTypes" />
</set>
<set name="coursePatterns" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.CoursePattern" />
</set>
<set name="evaluationPhaseMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.EvaluationPhaseMaster" />
</set>
<set name="roundingRuleMasters" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.RoundingRuleMaster" />
</set>
<set name="courseCategories" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.CourseCategory" />
</set>
<set name="attendanceStatuses" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.AttendanceStatus" />
</set>
<set name="feeStructures" inverse="true">
<key>
<column name="InstitutionID" not-null="true" />
</key>
<one-to-many class="com.amritatech.aums.hibernate.FeeStructure" />
</set>
</class>
</hibernate-mapping>


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

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.