db4o Developer Community

db4o open source object database, native to Java and .NET
Welcome to db4o Developer Community Sign in | Join
in Search
More Search Options

Will such kind of queries work?

Last post 01-24-2006, 10:54 AM by Tuna Toksoz. 3 replies.
Sort Posts: Previous Next
  •  01-21-2006, 12:57 PM 21977

    Angel [(A)] Will such kind of queries work?

    Hi all,

    if you ever play around with the formula 1 tutorial. Have you every tried such a query;

    Find car where Car.Pilot.point = 100

    I don't know how to convert such a query into SODA, any hints are greatly appreciated!

    /Meng
  •  01-21-2006, 02:29 PM 21979 in reply to 21977

    Re: Will such kind of queries work?

     Meng wrote:
    Have you every tried such a query;

    Find car where Car.Pilot.point = 100

    I don't know how to convert such a query into SODA, any hints are greatly appreciated!


    It's just like retrieveCarByPilotNameQuery() in the 'Structured Objects' tutorial chapter.

    query.constrain(Car.class);
    query
       .descend("pilot")
       .descend("points")
       .constrain(new Integer(100));


    Best regards,
    Patrick
  •  01-21-2006, 07:15 PM 21984 in reply to 21979

    Re: Will such kind of queries work?

    Thank you Partick, I get to like this fantastic software more and more now. it is so elegant solution for object orient computing.
  •  01-24-2006, 10:54 AM 22032 in reply to 21984

    Re: Will such kind of queries work?

    I recommend you Native Queries if you are not worry about performance issues.

    code would be like that:

    IList<Car> result = container.Query<Car>(delegate(Car c){return c.Pilot.Point==100;});

     

    seems nice, doesnt it?

View as RSS news feed in XML