How can I define a right outer join with QueryBuilder?
In the wiki is written as second parameter for the Method QBJoin.add()
{Number} joinType – join type, one of IQueryBuilderJoin#LEFT_OUTER_JOIN, IQueryBuilderJoin#INNER_JOIN, IQueryBuilderJoin#RIGHT_OUTER_JOIN, IQueryBuilderJoin#FULL_JOIN
For the JSRelation there are only INNER_JOIN and LEFT_OUTER_JOIN declared.
Do realize that not all RDBMS’s support a right outer join.
But since a right outer join is nothing more than a reversed left outer join you can reverse the right outer join to make it a left outer join (still with me here?
).
So the result of the following SQL:
SELECT * FROM tableA right outer join tableB ON (tableA.id=tableB.id)
is equal to
SELECT * FROM tableB left outer join tableA ON (tableB.id=tableA.id)
Hope this helps.
Gabriel,
These constants are indeed missing.
I will add constants to a future release, until then you can use 2 for right outer join and 3 for full join.
Rob