I just noticed that QueryBuilder accepts multiple OR's
Then i tested other fields, and noticed the same thing.
I saw nothing about this in the docs to confirm this functionality
outright, though it is used in examples
ie:
$results= $class->get_items(
query=> [
id=> $kw_args{'id'},
id=> 100,
or=> [
'id'=> { ne => $kw_args{'c'} },
'id'=> undef,
],
or=> [
'id'=> 5,
]
],
);
i also realized a query builder behavior that didn't come through on
the docs...
or=> [
'id'=> { ne => $kw_args{'c'} },
'id'=> undef,
],
is functionally the same as
id=> {
eq=> undef ,
ne => $kw_args{'c'} }
}
in fact, the Tutorial uses this example ( under fetch objects )
or =>
[
price => 5.00,
price => { lt => 10.00 },
],
which creates the same sql as
price => {
eq => 5.00,
lt=> 5.00
}
In any event, it basically means that at some point, field=>
{ stuff } was set as an OR condition.
Which is fine - it makes perfect sense ( although it would have also
made sense to be AND conditions )
I couldn't find anything in the docs that states this though, so I
was hoping some big bold letters could say something like
field => [VALUES]
field => {CONDITIONS}
Will always create an OR join for the values and conditions.
To have a field match multiple conditions, you must use multiple
"field=>" statements
another thing i noticed, is that
id => { eq=> [ 1,2,3] }
creates
( id= 1 OR id= 2 OR id=3 )
while
id => [ 1,2,3],
creates
id IN ( 1, 2,3 )
of course they're both functionally the same... but that caught my eye
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object