开发者

Help with HQL Joins

开发者 https://www.devze.com 2023-01-06 06:00 出处:网络
I have the following SQL which I can\'t work out how to convert to HQL.... SELECT dbo.Style.Id, dbo.Style.Name

I have the following SQL which I can't work out how to convert to HQL....

SELECT dbo.Style.Id, dbo.Style.Name
  FROM dbo.Price 
  JOIN dbo.PriceGroup ON dbo.Price.priceGroupId = dbo.PriceGroup.Id 
  JOIN dbo.Product ON dbo.Price.productId = dbo.Product.Id 
  JOIN dbo.Style ON dbo.PriceGroup.Id = dbo.Style.priceGroupId
 WHERE (dbo.Product.Id = 1)

...it would be e开发者_StackOverflow中文版xcellent if someone could tell me the answer, but also point me in the direction of some good HQL documentation/tutorials on the subject of joins. I've searched on google but haven;t been able to find anything comprehensive.


This is where I got started.

http://docs.jboss.org/hibernate/stable/core/reference/en/html/queryhql.html#queryhql-joins

0

精彩评论

暂无评论...
验证码 换一张
取 消