db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KERNEUZET FREDERIC" <Frederic.Kerneu...@pr-gicm.com>
Subject Problem with setDistinct()
Date Tue, 01 Mar 2005 13:17:48 GMT
Hi everyone,
 
I've got a problem with something quite "easy", and besides, already used in another place
in my application ...
 
The source code is :
====================
ArrayList listRole = new ArrayList();
listRole.add("Correspondant");
                  
criteria.addJoin( SalariePeer.USER_ID, TurbineUserGroupRolePeer.USER_ID );
criteria.addJoin(TurbineRolePeer.ROLE_ID, TurbineUserGroupRolePeer.ROLE_ID);             
    
criteria.addNotIn(TurbineRolePeer.ROLE_NAME,listRole);
                        
criteria.setDistinct();
 
List lstSalarie = SalariePeer.doSelect(criteria);
====================
 
It gives me an sql request without any column selected :
SELECT DISTINCT  FROM TURBINE_ROLE, SALARIE, TURBINE_USER_GROUP_ROLE WHERE TURBINE_ROLE.ROLE_NAME
NOT IN ('Correspondant') AND SALARIE.USER_ID=TURBINE_USER_GROUP_ROLE.USER_ID AND TURBINE_ROLE.ROLE_ID=TURBINE_USER_GROUP_ROLE.ROLE_ID
 
And an java.sql.Exception in thrown :
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Data type like
text, ntext or image cannot be selected as DISTINCT.
 
(error message translated from french)
 
As someone got an idea ?
 
 
Thanks !
==================================
Frédéric Kerneuzet
==================================
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message