Regular |
 |
Joined: Mon Oct 20, 2003 3:14 am Posts: 53 Location: Sterling, VA, USA
|
The docs claim that MySQL doesn't support subselects in the GA driver but that a beta one is coming out that does.
I tried this with MySQL 4.1.10, using both an old 3.0.15 JDBC driver and a "current" 3.2 beta driver. Both seemed to work.
Did I not hit upon the unsupported feature, or are the docs wrong, or is this just an "untested but it might work" issue?
TIA
-Joe
Hibernate version: 3b4
Code snippet that worked as expected:
Query m = session.createQuery("from UserEntity as u where u.userId not in ( select userId from Rep as userId)");
Iterator jj = m.iterate();
while (jj.hasNext())
{
UserEntity ue = (UserEntity) jj.next();
System.out.println("**** " + ue.getUserName());
}
Resulting SQL:
select userentity0_.UserId as col_0_0_ from UserEntity userentity0_ where (userentity0_.UserId not in(select rep1_.UserId from Rep rep1_ inner join UserEntity rep1_1_ on rep1_.UserId=rep1_1_.UserId))
_________________ "A statistician is a mathmetician, broken down by age and sex".
|
|