-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Incorrect SQL being generated for IN
PostPosted: Mon Dec 10, 2007 1:35 pm 
Newbie

Joined: Tue Mar 20, 2007 5:27 pm
Posts: 12
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.