-->
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: Simplest join
PostPosted: Tue Apr 08, 2008 1:42 pm 
Newbie

Joined: Mon Mar 05, 2007 5:21 am
Posts: 4
I've seen posts saying that this isn't possible without a theta join, giving me back *far* more rows than necessary. Despite my own cynicism of Hibernate, it'd be too absurd for that to be the only answer.

But, I digress. Is there a proper way to do this:

Code:
List<Course> courses = em.createQuery("from Course2007 c " +
        "join CourseMember mem " +
        "where c.term=mem.term and c.identifier = mem.identifier " +
        "and mem.pid=:pid and mem.role=:role")
        .setParameter("role", CourseMember.ROLE_INSTRUCTOR)
        .setParameter("pid", pid).getResultList();


There isn't any relationship defined for these two entities. There are good reasons for that.

Assuming that Hibernate has this basic functionality somewhere in here, how do I get to it?

Thanks in advance for any help?

_________________
Ph.D. Candidate, Computer Science
Virginia Tech


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.