Ok, so most of my SELECT .. IN stuff works except for one place in particular.
Using hibernate 3.2.5ga against MySQL.
The HQL is as follows:
Code:
SELECT DISTINCT tbl FROM AuthorityAssignment tbl LEFT JOIN FETCH tbl.authorityGroup authorityGroup WHERE tbl.accounts IN (:accounts)
The main difference between this and the the other queries I am running is that this is a ManyToMany definition (below).
Code:
@ManyToMany
@JoinTable(name = "MyTable",
joinColumns = { @JoinColumn(name = "assignment_id") },
inverseJoinColumns = { @JoinColumn(name = "account_id") }
)
private List<Account> accounts;
For some reason the SQL gets build as:
Code:
.... and accounts1_.account_id=account2_.id and (. in (? , ?)
Which is obviously not correct. The rest of the query looks fine, and the only error I get is an SQLGrammer exception.
Anyone seen this before? Thanks again for the help!