-->
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.  [ 2 posts ] 
Author Message
 Post subject: MySQL and Subselects seem to be working...
PostPosted: Sat Feb 19, 2005 10:45 pm 
Regular
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".


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 19, 2005 10:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Subselects work just fine in MySQL 4.1.


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

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.