-->
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: outer or full join must be followed by path expression
PostPosted: Wed Aug 25, 2004 2:55 pm 
Newbie

Joined: Mon Aug 02, 2004 12:11 pm
Posts: 10
Location: Mexico D.F.
Hibernate version: 2.3.1

Hi i have a doubt with a external query where i use a SQL string and the class Query , this is my function :


public List obtenEjecutivosXGrupo(String[] parametros) throws HibernateException{
ResourceBundle bundle;

bundle=ResourceBundle.getBundle("resources.GlobalExceptions");
if(parametros==null && parametros.length!=4 && parametros[0].trim().length()==0 && parametros[1].trim().length()==0 && parametros[2].trim().length()==0){
throw new IllegalArgumentException(bundle.getString("cat.obtenEjecutivosXGrupo.errParams"));
}
try{
String strQry=" SELECT G.id.flGrupo, G.dsGrupo, U.id.idPersona, U.fgEstatus, P.paterno, P.materno, P.nombre,U.flCampania,C.dsCampania ";
strQry+= " FROM TmkUsuario U INNER JOIN ixemkt.sd.catalogos.TmkGrupo G ON (G.id.clUnegocio = U.id.clUnegocio AND G.id.flGrupo = U.flGrupo AND G.id.flAnegocio = U.flAnegocio) INNER JOIN ixemkt.sd.catalogos.VwBupPersonaFisica P ON (P.idPersona = U.id.idPersona)";
//strQry= strQry + " VwBupPersonaFisica P, TmkCatalogoFijo F, TmkCampania C,
strQry+= " INNER JOIN ixemkt.sd.catalogos.TmkCatalogoFijo F ON (F.flRegistro = U.fgEstatus) LEFT OUTER JOIN ixemkt.sd.catalogos.TmkCampania C ON (C.flCampania = U.flCampania) " ;
strQry+= " WHERE U.id.clUnegocio = :uNegocio AND U.flAnegocio = :aDifusion AND U.flCampania = :idCampania ";

if(parametros[3]!=null && parametros[3].trim().length()>0 && Integer.parseInt(parametros[3])>=0){
strQry= strQry + " and U.flGrupo=:flGrupo ";
}
strQry= strQry + " GROUP BY G.id.flGrupo, G.dsGrupo, U.id.idPersona,P.paterno,P.materno,P.nombre,U.fgEstatus,U.flCampania,C.dsCampania";
strQry= strQry + " ORDER BY G.dsGrupo,U.id.idPersona,P.paterno,P.materno,P.nombre";

List retornoList = null;

Query runQry = getSession().createQuery(strQry);
runQry.setParameter("uNegocio", new Integer(parametros[0]));
runQry.setParameter("aDifusion", new Integer(parametros[1]));
runQry.setParameter("idCampania", new Integer(parametros[2]));
if(parametros[3]!=null && parametros[3].trim().length()>0 && Integer.parseInt(parametros[3])>=0){
runQry.setParameter("flGrupo", new Integer(parametros[3]));
}
Iterator it = runQry.iterate();
retornoList = new ArrayList();
VwObtenEjecutivosXGrupo VwObtenEjecutivosXGrupoObj = new VwObtenEjecutivosXGrupo();
while (it.hasNext()) {
Object[] tupla = (Object[]) it.next();
VwObtenEjecutivosXGrupoObj = new VwObtenEjecutivosXGrupo();
//Se validan los datos a ser formateados
if(tupla[0]!=null) VwObtenEjecutivosXGrupoObj.setFlGrupo((Integer)tupla[0]);
if(tupla[1]!=null) VwObtenEjecutivosXGrupoObj.setDsGrupo((String)tupla[1]);
if(tupla[2]!=null) VwObtenEjecutivosXGrupoObj.setIdPersona((Integer)tupla[2]);
if(tupla[3]!=null) VwObtenEjecutivosXGrupoObj.setFgEstatus((Integer)tupla[3]);
String nombre = "";
if(tupla[4]!=null) nombre=tupla[4].toString();
if(tupla[5]!=null) nombre+=" "+tupla[5].toString();
if(tupla[6]!=null) nombre+=" "+tupla[6].toString();
VwObtenEjecutivosXGrupoObj.setNomEjecutivo(nombre);
if(tupla[7]!=null) VwObtenEjecutivosXGrupoObj.setFlCampania((Integer) tupla[7]);
if(tupla[8]!=null) VwObtenEjecutivosXGrupoObj.setDsCampania((String) tupla[8]);
//agrego a la lista objeto de tipo VwObtenEjecutivosXGrupo
retornoList.add(VwObtenEjecutivosXGrupoObj);
}
return retornoList;
}
catch(Exception e ) {
throw new HibernateException("Error en el TmkUsuarioDAO --> obtenEjecutivosXGrupo : "+e.getMessage());
}
}




and this is the error that i received :

Error en el TmkUsuarioDAO --> obtenEjecutivosXGrupo : outer or full join must be followed by path expression [ SELECT G.id.flGrupo, G.dsGrupo, U.id.idPersona, U.fgEstatus, P.paterno, P.materno, P.nombre,U.flCampania,C.dsCampania FROM ixemkt.sd.catalogos.TmkUsuario U INNER JOIN ixemkt.sd.catalogos.TmkGrupo G ON (G.id.clUnegocio = U.id.clUnegocio AND G.id.flGrupo = U.flGrupo AND G.id.flAnegocio = U.flAnegocio) INNER JOIN VwBupPersonaFisica P ON (P.idPersona = U.id.idPersona) INNER JOIN TmkCatalogoFijo F ON (F.flRegistro = U.fgEstatus) LEFT OUTER JOIN TmkCampania C ON (C.flCampania = U.flCampania) WHERE U.id.clUnegocio = :uNegocio AND U.flAnegocio = :aDifusion AND U.flCampania = :idCampania GROUP BY G.id.flGrupo, G.dsGrupo, U.id.idPersona,P.paterno,P.materno,P.nombre,U.fgEstatus,U.flCampania,C.dsCampania ORDER BY G.dsGrupo,U.id.idPersona,P.paterno,P.materno,P.nombre]


My question is what do i need to correct this?, what's wrong ??
Help me please !.

Regards.


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.