-->
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.  [ 2 posts ] 
Author Message
 Post subject: JOIN - Newbie Question
PostPosted: Sun Sep 03, 2006 9:47 am 
Newbie

Joined: Sun Sep 03, 2006 9:39 am
Posts: 5
Hello
I've some problem with following mapping.
My class ReportForm has a field zsr which has a relation many-to-one to a look-up table users. When I display this class I would like also to have some information from this other table. I've tried with this mapping but the result is that none of the joined properties are fetched:

Code:
<class name="ReportForm" table="report">
  <id name="reportId" column="REPORT_ID"/>
  <property name="zsr" column="ZSR"/>
  <property name="patient" column="PATIENT"/>
  <join table="users" inverse="true" optional="true">
    <key column="ZSR" update="false"/>
    <property name="name" column="NAME" update="false" insert="false"/>
  </join>
</class>


Could you kind give me some suggestion how to do it correctly?
Thanks a lot
Patrick


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 03, 2006 11:36 am 
Newbie

Joined: Sun Sep 03, 2006 9:39 am
Posts: 5
Hello I've found a workaround to my problem.
Instead of a join do I use now

Code:
<many-to-one name="userForm" class="UserForm"
  column="ZSR" not-null="true" insert="false" update="false" lazy="false"/>


It's perhaps a bit overhead, since I need in read-only mode only a few properties of this class... but at least it works!

Regards,
Patrick


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.