Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Query work in 2.0.1 but don't in 2.3.2
Query work in 2.0.1 but don't in 2.3.2 [message #816946] Fri, 09 March 2012 07:58 Go to next message
Eclipse UserFriend
Hi,

I'm migrating a system from Glassfish 3.0.1/EclipseLink 2.0.1.v20100213-r6600 to Glassfish 3.1.2/EclipseLink 2.3.2.v20111125-r10461 and find some problems with JPA.

In a few I managed workarounds, but there is a namedquery that I couldn't:

select u from Representante u 
  where exists (select pj from PessoaJuridica pj where pj=u.pessoa and upper(pj.agrupamentoPJ.razaoSocial) like :descricao) 
  or exists (select pf from PessoaFisica pf where pf=u.pessoa and upper(pf.nome) like :descricao)


Representante extends Distribuidor that extends EntidadeIntegradaPessoa that have a @OneToOne with Pessoa

PessoaJuridica extends Pessoa
PessoaFisica extends Pessoa

All tables names have prefix GER or ESTG plus class name

The query above want to find Representante that have association with PessoaFisica or PessoaJuridica with some text description.

With EclipseLink 2.0.1 is working, but EclipseLink 2.3.2 I have this sql error :
SELECT t0.ID, t0.DTYPE, t0.ATIVO, t0.OPTIMISTICLOCK, t1.ID, t1.PESSOA_ID, t2.ID, t2.ALCANCE, t2.CALCULOCOMISSAO, t2.COMISSAO, t2.DESCRICAO, t2.GERARCARGA, t2.LANC, t2.LIMITEDESCONTO, t2.LOTEPEDIDOS, t2.NOME, t2.NRPEDFINAL, t2.NRPEDINICIAL, t2.RECEBECOMISSAO, t2.SENHALIBERACAO, t2.STATUS, t2.TABELAPRECO_ID, t3.ID, t3.ALTERARPV, t3.SUPERVISOR, t3.ID_SUP 
FROM ESTGREPRESENTANTE t3, ESTGDISTRREPRES t2, ESTGENTIDADEINTEGRADAPESSOA t1, ESTGENTIDADEINTEGRADA t0 
WHERE ((EXISTS (SELECT ? 
                FROM GERPESSOAJURIDICA t5, GERPESSOA t4, GERAGRUPAMENTOPJ t6 
                WHERE ((((t4.ID = t1.PESSOA_ID) 
                   AND UPPER(t6.RAZAOSOCIAL) LIKE ?) 
                   AND ((t5.ID = t4.ID) 
                   AND (t4.DTYPE = ?))) 
                   AND (t6.NUMEROCNPJ = t5.NUMEROCNPJ))
               ) 
       OR EXISTS (SELECT ? 
                  FROM GERPESSOAFISICA t8, GERPESSOA t7 
  ======>>>>        WHERE (((t4.ID = t1.PESSOA_ID)   
                    AND UPPER(t8.NOME) LIKE ?) 
                    AND ((t8.ID = t7.ID) 
                    AND (t7.DTYPE = ?))))
        ) 
        AND (((t3.ID = t0.ID) 
        AND ((t2.ID = t0.ID) 
        AND (t1.ID = t0.ID))) 
        AND (t0.DTYPE = ?)))


ERROR:  missing FROM-clause entry for table "t4"
LINHA 13:                   WHERE (((t4.ID = t1.PESSOA_ID) 

This query is wrong. t4 should be replaced by t7

Some help?

Thanks!
Luciano




[Updated on: Fri, 09 March 2012 08:00] by Moderator

Re: Query work in 2.0.1 but don't in 2.3.2 [message #825176 is a reply to message #816946] Tue, 20 March 2012 11:16 Go to previous message
Eclipse UserFriend
Seems like a bug. Can you try the latest 2.4 build? Does the error still occur?
If so, please log a bug.
Previous Topic:"No [EntityType] was found" Error with Spring 3.0.5 and EclipseLink 2.3.2
Next Topic:Customizing JPA entity generation
Goto Forum:
  


Current Time: Wed Jul 23 16:31:25 EDT 2025

Powered by FUDForum. Page generated in 0.03930 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top