I have the same problems with this in 0.9.8, however at the order by if I pass in the ID of the column in repository instead the column name it will run. Previoulsy I don't have any problems in version 0.9.5.
> -----Original Message----- > From: Ryan Vanderwerf [mailto:[EMAIL PROTECTED]] > Sent: 08 January 2003 01:01 > To: OJB Users List > Subject: 0.9.8: QueryBySQL broken on ORDER BY? > > > I'm passing some manual SQL into the QueryBySQL class that > worked in 0.9.7 that seems broken in 0.9.8 - it seems to be > re-parsing my query and turning it into a select count(*) > from a select *. For example I pass it the following SQL: > select * from MDP_V_USR_APP, MDP_ANSWERS A6_0 WHERE > PENDING_FLAG = 'N' AND CATALOG_FLAG = 'Y' AND > ((APPLICATION_ID in (select ENTITY_ID from MDP_ANSWERS where > FREEFORM like '%%' and ENTITY_TABLE_ID = 3)) or > APPLICATION_NAME like '%%' or APPLICATION_DESCRIPTION like > '%%' or FIRST_NAME like '%%' or LAST_NAME like '%%') AND > (A6_0.ENTITY_ID=APPLICATION_ID AND A6_0.ENTITY_TABLE_ID=3 AND > A6_0.POSSIBLE_ANSWER_ID=162) order by APPLICATION_NAME > > > Results in: > 1041954266766|3|10|statement||select count(*) from MDP_V_USR_APP, > MDP_ANSWERS A6_0 WHERE PENDING_FLAG = 'N' AND CATALOG_FLAG = > 'Y' AND ((APPLICATION_ID in (select ENTITY_ID from > MDP_ANSWERS where FREEFORM like '%%' and ENTITY_TABLE_ID = > 3)) or APPLICATION_NAME like '%%' or APPLICATION_DESCRIPTION > like '%%' or FIRST_NAME like '%%' or LAST_NAME like '%%') AND > (A6_0.ENTITY_ID=APPLICATION_ID AND A6_0.ENTITY_TABLE_ID=3 AND > A6_0.POSSIBLE_ANSWER_ID=162) order by APPLICATION_NAME which > throws a nice sql exception of course, since why would you > user ORDER BY on a count. > > In 0.9.7 it generates this (which works): > 1041953920242|71|6|statement||select * from MDP_V_USR_APP, MDP_ANSWERS > A6_0 WHERE PENDING_FLAG = 'N' AND CATALOG_FLAG = 'Y' AND > ((APPLICATION_ID in (select ENTITY_ID from MDP_ANSWERS where > FREEFORM like '%%' and ENTITY_TABLE_ID = 3)) or > APPLICATION_NAME like '%%' or APPLICATION_DESCRIPTION like > '%%' or FIRST_NAME like '%%' or LAST_NAME like '%%') AND > (A6_0.ENTITY_ID=APPLICATION_ID AND A6_0.ENTITY_TABLE_ID=3 AND > A6_0.POSSIBLE_ANSWER_ID=162) order by APPLICATION_NAME > > This is also happening in other places where I use that class > and pass in a query with an ORDER BY. Any ideas on what > functionality changed in QueryBySQL between .97 and .98? > > Ryan > > > > -- > To unsubscribe, e-mail: > <mailto:ojb-user-> [EMAIL PROTECTED]> > For > additional commands, > e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
