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: Simple Join with two keys
PostPosted: Thu Mar 26, 2009 5:50 pm 
Newbie

Joined: Sun Nov 18, 2007 4:57 pm
Posts: 5
I've been searching for hours and it's starting to make me feel like Hibernate isn't all it's cracked up to be.

I have two tables, and I need to create one class from these two tables. One of the tables, I only need one field, so I figured I would use a <join> to get that property.

Well the table I'm joining to has two criteria. Match on ID AND user == 'webuser'.

Here is what I have so far:

Code:
<composite-id>
         <key-property name="formId" column="form_id"/>
         <key-property name="id" column="field_id"/>
      </composite-id>

      <join table="FIELD_T" inverse="false" optional="false">
         <key column="FIELD_ID" update="false" />
         <property name="name" column="NAME"/>
      </join>

The Join does not have anything in it to filter the user == "webuser", also when I run the app like this, it gives me an error saying there needs to be as many columns as the referenced primary key... which there is no "form_id" in the second table.

Please help.


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.