![]() |
![]() |
|
[
Permalink
| « Hide
]
Clive Cox added a comment - 22/Jul/06 05:54 PM
Test case
Don't understand the query.
Query query = pm.newQuery(A.class, "(this instanceof org.jpox.test.B && (org.jpox.test.B)this == b) || (this instanceof org.jpox.test.C && (org.jpox.test.C)this == c)"); query.declareVariables("org.jpox.test.B b; org.jpox.test.C c"); so what is the cast achieving ? and the comparison with an unbound variable ? All that last part will do is bring in an INNER JOIN. Do you really just want to do Query query = pm.newQuery(A.class, "(this instanceof org.jpox.test.B) || (this instanceof org.jpox.test.C)"); Seems much more sensible to me, and works with SVN trunk I'm afraid as it is so long ago I can't remember why I had this particular query (it maybe in the real example from my project, I was getting the variable from a collection first and then doing the class tests)
However, the query should still work and not fail even if its not the most elegant formulation. As I said, the query doesnt make sense to me, hence I cant see what is "it should work".
Downgraded to minor since the real issue is specified in http://www.jpox.org/servlet/jira/browse/RDBMS-70
11 tests for instanceof.
Result for 1.2.0-beta5: Failed tests: 4 MySQL 5.1.12 And of the errors, they are typically http://www.jpox.org/servlet/jira/browse/RDBMS-71 due to the fact that when you have no discriminator there is no simple way of generating the SQL necessary to find the information the query needs (but you could just add a discriminator and it all becomes much more efficient - what would be recommended for many use-cases). Of course people could contribute code ...
I moved tests to http://www.jpox.org/servlet/jira/browse/RDBMS-71
Query issues like this will not be addressed with the legacy JDOQL implementation; wait for "JDOQL2" to be complete
DataNucleus 2.x has JDOQL2 pretty much complete
|
||||||||||||||||||||||||||||||||||||||||||||||||||||