I think you have to use two queries and merge the results afterwards in your code. As you said, datastore does not allow you to use inequality filters and logical "or" operators on more than one property. I guess from a performance perspective this doesn't make much difference. Appengine would have to translate the statement into separate queries anyway.
Cheers, Chris On Mar 23, 8:09 am, Amaan <amaan.m...@gmail.com> wrote: > I have a class College declared with location and fName String fields. > I am trying to retrieve values from that table using the following > query. On execution it says that SQL construct is not supported by the > JDO in googe app engine. > > Query query = pm.newQuery("javax.jdo.query.SQL", "select * from > College where location like '"+xxxx+"' or fName like '"+yyyy+"'"); > query.setClass(College.class); > College results = (College)query.execute(); > > How can i solve this problem? If i try to use > > Query query = pm.newQuery("select from > com.strutsgoogle.CollegeApp.College where location == '"+ location+"' > && fName=='amaan'"); > List <College>entries = (List<College>) query.execute(); > > This result set would only return me results based on the condition if > both the criterias location and fName are true. how can i get somethg > in which i may not pass any value for the fName parameter and still > get results for all the locations. || operator can be applied to the > same field from the table and not multiple fields. > > SQL query: select * from college where location like 'xxxx.' or fName > like 'yyyy' > Can somebody help me in getting the JDOQuery supported by google app > engine for the above mentioned SQL query construct?? -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.