openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abe White <>
Subject Re: FW: A consult request for a SQLServer SQL problem from JPA
Date Wed, 26 Mar 2008 18:26:43 GMT
Joe --

I've been asked to help with this issue.  Unfortunately SQL generation
is the messiest part of the OpenJPA codebase, and it'll take me some
time to remember how it all works.  To start with, can you show me the
JPQL (or JDOQL) query that's generating the alias-less subselect?

Also, please attach the relevant entities and code.

> > A JPA bug I am working on finds a weakness in MS's SQLServer,
> > from a query generated by JPA.
> >   I have the problem isolated, and have a possible solution path,
> > but not yet enough insight into the SQL generation of OPENJPA to
> > quickly know the right approach to fixing it. Below is a JDBC
> > query line where I duplicate the problem query by hand.
> > 
> >   The simple issue is that the select asks for one of it's
> > columns returned as a subselect, and then asks that the
> > results be ordered by that subselect. The DBMS is throwing
> > a spurious error message, saying that in order to do a
> > SELECT DISTINCT/ORDER BY, the select list has to contain the
> > column to be ordered by. It's spurious because the query
> > clearly does list the identical subselect in the select list
> > and the order-by, but the DBMS is apparently not smart enough
> > to equate those.

Notice:  This email message, together with any attachments, may contain information  of  BEA
Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,
 copyrighted  and/or legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient, and have received
this message in error, please immediately return this by email and then delete it.

View raw message