-->
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: Theta style join: Mapped table to an unmapped table
PostPosted: Tue Jul 22, 2008 11:46 am 
Newbie

Joined: Tue Jul 22, 2008 11:30 am
Posts: 13
Hello,

I have a table that is mapped to a class and what I want to do is pull results from that mapped table based on results from an unmapped table.

Here’s an example of what I’m trying to do:

Table Rounds (this table is mapped in my hbm config and I can query off of it fine)
Id
round


Table ActiveRounds (this is not mapped)
Id
Active round

I want to get all of the entries from the Rounds table, were the round is an active round.
The sql for this is

Select * from Rounds a inner join ActiveRounds b on a.id=b.id and a.round=b.active_round

Do I have to map ActiveRounds to a class to do this query? This post from a year ago: http://forum.hibernate.org/viewtopic.ph ... 5af7f955bd

Said to use theta style joins and HQL But when I do:

From Rounds rounds, ActiveRounds activeRounds where rounds.id = activeRounds.id and rounds.round = activeRounds.activeRound

I get org.hibernate.hql.ast.QuerySyntaxException: ActiveRounds is not mapped

Thanks!


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.