Re: OR?

Anthony 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.
>
>

Dr Anthony Berglas, [email protected]       Mobile: +61 4 4838 8874
Just because it is possible to push twigs along the ground with ones nose
does not necessarily mean that is the best way to collect firewood.

------------------------------------

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/
1283eccf.jpg (image/jpeg, 3.3 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.