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

How to fetch only parent objects?

Last post 09-02-2008, 02:50 PM by mjablonski. 1 replies.
Sort Posts: Previous Next
  •  09-02-2008, 11:33 AM 50875

    How to fetch only parent objects?

    hi,

    I have an simple inherited object. eg:  Child extends Parent.

    When I query Parent objects, I get both child & parent. Is there a way to fetch only parent objects using SODA ?

    thanks in advance.

    Filed under: ,
  •  09-02-2008, 02:50 PM 50879 in reply to 50875

    Re: How to fetch only parent objects?

    Hi,

    I'm not aware of any direct solution. AFAIK the class indices within db4o are including the subclass instances, so this knowledge is not available.

    Two workarounds:

    - Run two queries against Parent.class and Child.class and remove all Children from Parents-ObjectSet.

    - Use an SODA-Evaluation.

    Cheers, Maik


    http://db4o.blogspot.com/
View as RSS news feed in XML