Precaution while designing database: Never have the same column names for 2 potential join candidates
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Tim Holloway wrote:Isn't that a cross-product join?
Tim Holloway wrote:You didn't mention, incidentally, whether you're doing old-style Hibernate or Hibernate JPA. But your queries don't look JPA-like.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Tim Holloway wrote:No, I'm pretty sure that that IS a Cartesian join. You aren't seeing it because your "id" fields are presumably unique, but rename them to "city" and consider what would come back (assuming multiple entries per city on both tables).
Consider Paul's rocket mass heater. |