开发者

Complex sentence on HQL

I would like realize the following sentence on HQL. could someone help me to translate the SQL sentence to HQL? select distinct device.description from device, attribute w开发者_C百科here attribute.deviceid = 1 and device.nodeid = 1 Thanks in advance! Regards!


This is my try:

select distinct Device.description from Device d 
inner join Attribute 
where d.nodeid = 1

I supposed your classes have been named conventionally and your relation is like this:

attribute.deviceid = device.nodeid


Actually the strict equivalent of from x,y is a cross join and not an inner join. But the result would be the same.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜