Re: S.O.D.A. database Query API - call for comments

From: Carl Rosenberger <carl_at_db4o.com>
Date: Wed, 9 May 2001 01:20:54 +0200
Message-ID: <9d9v3o$gcs$01$1_at_news.t-online.com>


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 Wed May 09 2001 - 01:20:54 CEST

Original text of this message