Skip to content Skip to sidebar Skip to footer

Ormlite Join Queries With Query Builder

I'm having some issue with understanding join queries in ormlite. ormlite query builder supports 4 join methods. 1. join() 2. joinOr(); 3. leftJoin(); 4. leftJoinOr(); I can under

Solution 1:

Please explain me other join methods using similar pictures?

I've spent a lot of time on the javadocs. They should be helpful. They explain what SQL is being used and that the "Or" part is.

  1. join() is the same as a SQL INNER JOIN as stated in the javadocs. That matches your picture.

  2. joinOr() is the same as a SQL INNER JOIN but the WHERE parts of the two queries are "OR'd" together as stated in the javadocs. Same picture as #1.

  3. leftJoin() is the same as (wait for it) a SQL LEFT JOIN as stated in the javadocs. That corresponds to adding A to the area in red. See your linked post and look for LEFT JOIN.

  4. leftJoinOr() is the same as a SQL LEFT JOIN as well but the WHERE parts of the two queries are "OR'd" together as stated in the javadocs. Same picture as #3.

Post a Comment for "Ormlite Join Queries With Query Builder"