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.
精彩评论