-->
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.  [ 6 posts ] 
Author Message
 Post subject: QuerySyntaxException. Problem trying to join classes
PostPosted: Sun Jan 01, 2006 8:29 am 
Newbie

Joined: Sun Jan 01, 2006 8:19 am
Posts: 8
Hi there!

Could anyone of you please tell what is wrong with the Syntax of the following query?

FROM ConfigLocalValue configLocalValue INNER JOIN
ConfigValue configValue on configLocalValue.configValue.valueID=configValue.valueID

INNER JOIN ConfigValueCategory configValueCategory ON

configValueCategory.metaID=configValue.configValueCategory.metaID

AND configValueCategory.metaID=12

AND configLocalValue.languageID =1


(It seems to be a general syntax problem, so the mappings are not that important I think)

Thanks in advance!

Toby


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 01, 2006 1:33 pm 
Regular
Regular

Joined: Wed Jun 29, 2005 11:14 pm
Posts: 119
Location: København
I don't think you need the following

on configLocalValue.configValue.valueID=configValue.valueID
ON onfigValueCategory.metaID=configValue.configValueCategory.metaID

The mapping file specifies what they are joined on I think...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 01, 2006 1:36 pm 
Regular
Regular

Joined: Wed Jun 29, 2005 11:14 pm
Posts: 119
Location: København
So something more like:

FROM ConfigLocalValue configLocalValue
INNER JOIN configLocalValue.configValue configValue
INNER JOIN configValue.configValueCategory configValueCategory
WHERE configValueCategory.metaID=12
AND configLocalValue.languageID =1


Top
 Profile  
 
 Post subject: Syntax: Join
PostPosted: Mon Jan 02, 2006 9:50 am 
Newbie

Joined: Sun Jan 01, 2006 8:19 am
Posts: 8
Thanks!


Top
 Profile  
 
 Post subject: Joining 2 joins.....
PostPosted: Mon Jan 02, 2006 10:02 am 
Newbie

Joined: Sun Jan 01, 2006 8:19 am
Posts: 8
So this maps localized values to "values"

From ConfigLocalValue configLocalValue
INNER JOIN configLocalValue.configValue configValue
INNER JOIN configValue.configValue.configValueCategory configValueCategory


and that links Users to Values using the UserValues mappting table.

From UserValue userValue
INNER JOIN userValue.user user
INNER JOIN userValue.configValue configValue
INNER JOIN configValue.configValue.configValueCategory configValueCategory


If I want to join now all localized values to User how would I do that?

From ConfigLocalValue configLocalValue
INNER JOIN configLocalValue.configValue configValue
INNER JOIN configValue.configValue.configValueCategory configValueCategory,

???

JOIN UserValue userValue
INNER JOIN userValue.user user
INNER JOIN userValue.configValue configValue
INNER JOIN configValue.configValue.configValueCategory configValueCategory

Like that?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 02, 2006 11:01 am 
Regular
Regular

Joined: Wed Jun 29, 2005 11:14 pm
Posts: 119
Location: København
Looks reasonable, it's hard to say from the info given though.

Have a good read of chapter 14.3 of the manual. It'll teach you how to do build it up and is only 1 page long.

If that solution above worked, do I get my first credit ;o)


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