Search code examples
c#database-designobjectdb4oobject-oriented-database

unsupported class hierarchy change in Db4o


I have:

static class Db4o...

and:

class Db4oBase... // which uses Db4o class

where I can:

class Customer : Db4oBase
{
    public Customer(string name)
    {
    }
}

so that I can:

Customer customer = new Customer("Acbel Polytech Philippines");

customer.store();  //something like that

It worked, until sometime in my development, the code below suddenly bugged down:

class Db4o
{
    .
    .
    .
    public static IObjectSet Retrieve(object obj)
    {
        IObjectSet objectSet = null;

        objectSet = container.Ext().QueryByExample(obj); // This part of the code
                                                         // throws a unsupported
                                                         // class hierarchy.

        return objectSet;
    }
}

The QueryByExample instruction throws an unsupported class hierarchy. Does anybody know what should I do?


Solution

  • It happened when you:

    1. Code a class and then run the program.
    2. Later you modify the code and add/change the parent class (changing the hierarchy)
    3. Finally you run again and ... CRASSHHH.

    yes, Hierarchy (inheritance) is supported but change it is not so simple to apply on existent file.