Re: OR?
Anthony & Melissa Berglas <[email protected]>
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <[email protected]> |
For now you just say
new SQuery...rawPredicate("NAME LIKE '?' OR NAME = '?", "SM%", "Jones")...
Ie raw SQL fragment.
The goal of SQuery is to cover the 90% of simple queries, and provide
the full power of SQL for the rest. Thus to keep it simple.
or() was dropped in 3.* because the semantics were not quite
clear. A disjunction operator could be added later if really useful,
but there are hard choices as to what the syntax should really be.
A more useful thing to me would be able to do subselects with something like
...gt(Employee.SALARY).value(Employee.DEPARTMENT, Department.MAX_SALARY)
Contributions along these lines would be most welcome.
Anthony
At 09:56 AM 20/10/2008, you wrote:
>I'm new to SimpleORM and I'm trying to figure out how to express a
>query like this...
>SELECT * FROM CUSTOMER WHERE NAME LIKE 'SM%' OR NAME = 'Jones'
>
>FYI, I have downloaded the code for version 3.3.
>I did some Googling and it looks like the SQuery class used to have
>and() and or() methods but those methods no longer exist.
>
>
Spreadsheet Detective,
Southern Cross Software Queensland Pty Limited
54 Gerler Street
Bardon, Queensland 4065, Australia.
Email: [email protected]
www.SpreadsheetDetective.com
Ph: +61 427 830248 (Australian Eastern Standard Time)
"If the model seems correct only because the numbers look right,
then why build the model in the first place?"
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/SimpleORM/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/SimpleORM/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
1282bb53.jpg
(image/jpeg, 3.3 KB) - not displayed