| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: S.O.D.A. database Query API - call for comments
mikito Harakiri wrote:
> How about finding all red cars with alloy wheels?
>
> class Car{
> Wheel[] wheels;
> Color color;
> }
>
> class Wheel {
> boolean isAlloy;
> }
>
> Query carNode = db.query();
> carNode.constrain(new Car());
> carNode.getSubNode("color").constrain(new Color("red"));
> carNode.getSubNode("wheels")
> getSubNode("isAlloy").constrain(new Boolean(true));
> ObjectSet res = carNode.execute();
...looking over your example a second time...
...of course your posted code-snipped works fine...
The original thought was the following, to minimize the usage of strings:
Query carNode = db.query();
Car carExample = new Car();
carExample.color = new Color("red");
carNode.constrain(carExample);
Wheel wheelExample = new Wheel();
wheelExample.isAlloy = true;
carNode.getSubNode("wheels").constrain(wheelExample);
ObjectSet res = carNode.execute();
However the problem I expressed in my first reply to your posting persists: If I want to set further evaluation criteria for member values on "examples" there is still a problem.
Kind regards,
Carl
Received on Tue May 08 2001 - 18:20:54 CDT
![]() |
![]() |