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: Hibernate Mapping
PostPosted: Mon Oct 17, 2011 6:10 am 
Newbie

Joined: Thu Oct 13, 2011 4:37 pm
Posts: 2
Hello,


I have some query regarding parent child fetching strategy.
In the below given .hbm file i just want to fetch the Parent Project not its child projectRatings, officerProjectManagers , contractorProjectManagers.
How is it possible.
Please suggest.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="org.ariose.model.Project" table="project" >

<id name="projectId" column="project_id" unsaved-value="0">
<generator class="increment" />
</id>

<many-to-one name="wardMaster" class="org.ariose.model.WardMaster" fetch="select" lazy="false">
<column name="ward_id" not-null="true"></column>
</many-to-one>

<many-to-one name="zoneMaster" class="org.ariose.model.ZoneMaster" fetch="select" lazy="false">
<column name="zone_id" not-null="true"></column>
</many-to-one>

<property name="projectName" column="project_name" not-null="true"/>
<property name="projectDescription" column="project_desc" not-null="true"/>
<property name="qaTeam" column="qa_team" not-null="true"/>
<property name="awarded" column="awarded" not-null="true"/>
<property name="status" column="status" not-null="true"/>
<property name="creationDate" column="creationDate" not-null="false"/>


<set name="projectRatings" table="project_rating" lazy="false" fetch="join">
<key>
<column name="project_id" not-null="true"></column>
</key>
<one-to-many class="org.ariose.model.ProjectRating"></one-to-many>
</set>

<set name="contractorProjectManagers" table="contractor_project_manager" lazy="true" fetch="join">
<key>
<column name="project_id" not-null="true"></column>
</key>
<one-to-many class="org.ariose.model.ContractorProjectManager"></one-to-many>
</set>


<set name="officerProjectManagers" table="officer_project_manager" lazy="false" fetch="join">
<key>
<column name="project_id" not-null="true"></column>
</key>
<one-to-many class="org.ariose.model.OfficerProjectManager"></one-to-many>
</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.  [ 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.