daelmo wrote:
_RPB.Relations.Add( AreaCodeTimeZoneEntity.Relations.SystemTimeZoneEntityUsingTimeZone, JoinHint.Left)
This is
AreaCodeTimeZone LEFT JOIN SystemTimeZone
Remember to flag __RPB.Relations.ObeyWeakRelations = true.
_
Ref.: LLBLGenPro Help - Using generated code - Adapter - Filtering and sorting - Advance filtering usage - Weak relations.
I've to correct you in this, Daelmo
ObeyWeakRelations is one way to specify left/right joins: let the system figure it out. However if you want fine grained control, you can specify join hints and should leave ObeyWeakRelations to false as they can't be used together.
ObeyWeakRelations was added as a convenience method a long time ago so people didn't have to specify the join direction per se. However in some situations it could give odd results, so we added the join hints as well, which are more precise.
I'd recommend the join hints over ObeyWeakRelations as join hints give you the power to specify exactly which join you want to have.
A left join specification could end up as a RIGHT join in the end query. This is because with the join hint you specify which part is joined towards which part. So A.relations.B and then using a joinhint LEFT, means B is joined towards A, so all A's are in the result and where available, the B's. (A left join B).
However, if B is already in the join list (select * from D join C join B), it will be the case that a statement like .. JOIN A ON ... has to be appended, which means that to keep the join direction in tact, it will become FROM ... B ON ... RIGHT JOIN A ON A.. = B.. , as that will result in the same query.
So don't be surprised if a left join hint will give a RIGHT JOIN query fragment, the query builder knows what you mean with the join hint and thus will specify the correct join operator.