2

Is it possible to add additional restrictions in a join in hql?

The sql:

LEFT JOIN dbo.PersonOrder OP ON OP.ID_PERSON = P.ID AND OP.ID_ORDER = 3

Is it possible to get this in hql, linq or queryover? I have a many to many relation between Person and Order. On the left side, I want all Person objects and on the right side, i need null or the order with id 3 (if there is a link between that person and order number 3).

Thanks in advance

4

1 回答 1

1

使用with关键字

LEFT JOIN dbo.PersonOrder OP WITH OP.ID_ORDER = 3 
于 2012-12-17T06:57:28.890 回答