Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. COWhoops, OK then, thanks for the heads-up about ExpressionParser not being suited for SQL parsing. What led me to believe it was OK to do that is http://cayenne.apache.org/docs/3.0/in-memory-evaluation.html which I found from the post http://stackoverflow.com/questions/898405/how-to-implement-a-sql-like-like-operator-in-java but I might have taken my conclusions a bit too far in thinking that I could parse whole SQL expressions.
      singulars
    2. COThis is what I do: `String where = "Name='Al' and (City='Ai' or Country='Ai')";` `Expression expression = Expression.fromString(where);` That `expression` instance definitely comes to contain just the tokens I expect. Now, that `Expression.fromString(String)` Cayenne method uses the `ExpressionParser` in the same way I do: `return new ExpressionParser(reader).expression();` So should I just conclude that while my `where` string in my intention is in SQL syntax, it's actually Cayenne syntax which in this case happens to match SQL syntax but I shouldn't rely on this being the case for other SQL?
      singulars
    3. COYes, this particular WHERE is semantically similar with Cayenne expressions. In general this may not be the case. So if you are writing your own parser (and couldn't find a decent open source SQL parser out in the wild, which you should be able to do), you can take ExpressionParser.jjt from Cayenne and extend it for your needs, and the compile it with javaCC. But that the hard way.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload