Arsenalist

The Toronto Raptors Blog with an Arsenal touch

Performing a LEFT OUTER JOIN using JPQL and JPA

Posted by Arsenalist on November 20, 2007

9 Responses to “Performing a LEFT OUTER JOIN using JPQL and JPA”

  1. Tech Per Says:

    Hi, nice example of left outer join. You write:

    …an installment of documenting something that should be already documented.

    I don’t know if you mean that it isn’t documented, because it is. Quite well, actually. In part 4.4.5.2 in the persistence part of the specifaction of EJB3.0. This is JSR-220.

  2. Web 2.0 Announcer Says:

    Performing a LEFT OUTER JOIN using JPQL and JPA

    [...]Haven’t made a tutorial-type post in a while so here’s an installment of documenting something that should be already documented. The problem at hand is s very common one: how do you do a LEFT OUTER JOIN on two tables (entities) when you’re …

  3. Verdeen Says:

    Good example, the bridge from SQL to ORM query languages such as HQL and JPQL is often too confusing and the underlying SQL that is generated is vastly different from the actual query. There needs to be a reverse engineering tool from SQL to JPQL.

  4. 666snippets Says:

    *searches JPQL tutorials*

  5. 666snippets Says:

    looking at this increments my love for iBatis

  6. vardomn Says:

    c4torcadomtr

  7. Jhoss Says:

    Hi, I’m from Bolivia, and I want to know JPQL, a basic example… please…

  8. Mike Says:

    Great Left Outer Join Example, Thank you!

  9. Nate Says:

    Thank you for the easy to follow example. My situation, however, is a bit more complex. I’m joining on dates and in the first table, the date is represented as an integer (yyyyMMdd) and in the second, as a date field.

    I’ve tried everything including using the getter/setter methods to convert the Date to a Long and back, but I always get a “java.sql.SQLException: [SQL0401] Comparison operator = operands not compatible.” as the SQL it generates seems to be be comparing the data types as they’re stored in the database and I’m not sure how to get JPA/Toplink to do otherwise.