db4o querying subobject

Go To StackoverFlow.com


I've just started with db4o and I stumbled on to a problem.

I have an object with a subobject (it is probably not the correct word but I hope you get what I mean).

The subobject contains two dates, one start date and one end date.

I would like to show the main object if it has at least one sub object where DateTime.Now is inbetween the start and end date.

I have to use native query or SODA (linq isn't working in the project).

Thanks in advance!


2009-06-16 07:45
by Fred


I would try something like this:

IQuery query = db.Query();
IConstraint constr1 = query.Descend("enddate")
IConstraint constr2 = query.Descend("startdate")
IObjectSet result = query.Execute();
2009-09-11 00:40
by mr_georg
Thanks, this fixed my problem as well - Contango 2011-02-23 17:57