-->
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: Neulingsfrage: left join in JPA QL
PostPosted: Fri Oct 26, 2007 4:54 pm 
Newbie

Joined: Fri Oct 26, 2007 9:30 am
Posts: 11
Hallo,
Ich möchte den folgenden SQL Query in JPA QL schreiben:
Code:
select f.*, p.name from tbl_formats f left outer join tbl_products p on f.product_id = p.id;


Ich habe vieles probiert, meistens bekomme ich einen "unexpected token error".

Die Domain Objekte heissen
Code:
Product
für Records aus tbl_products und
Code:
Format
für Objekte aus der tbl_format Tablle.

Danke

jacques


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 26, 2007 7:02 pm 
Newbie

Joined: Fri Oct 26, 2007 9:30 am
Posts: 11
Code:
SELECT distinct v FROM Format v " +
              "left join fetch v.product "


simple ;)


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.