Db4o 中不支持的类层次结构更改
我有:
static class Db4o...
并且:
class Db4oBase... // which uses Db4o class
在我可以的地方:
class Customer : Db4oBase
{
public Customer(string name)
{
}
}
这样我就可以:
Customer customer = new Customer("Acbel Polytech Philippines");
customer.store(); //something like that
它起作用了,直到在我开发的某个时候,下面的代码突然出现问题:
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;
}
}
QueryByExample 指令抛出一个不受支持的类层次结构。有人知道我应该做什么吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您执行以下操作时就会发生这种情况:
是的,支持层次结构(继承),但更改它应用于现有文件并不那么简单。
It happened when you:
yes, Hierarchy (inheritance) is supported but change it is not so simple to apply on existent file.
不知怎的,你的类层次结构已经改变了——这是 db4o 不直接支持。不管发生什么,您有以下选择(来自 db4o 文档):
package
Somehow your class hierachy has changed -- which is not directly supported by db4o. What ever happend, you have the following options (from db4o docs):
package
好吧,这就是我为消除异常所做的事情。我刚刚创建了另一个干净的数据库文件。但我还没有找出导致该错误的根本原因是什么。还没有时间。但它删除了“不支持的类层次结构更改”异常。因此,如果你们中的任何人遇到此问题,您可能想尝试执行我所做的操作,但如果您知道根本原因,请将其发布在这里作为答案。谢谢。
Okay this is what I did to remove the exception. I just created another clean database file. But I haven't find out what is the root cause that led to that error. No time for that yet. But it removed the "Unsupported class hierarchy change" exception. So if any of you encountered this you might want to try doing what I've done but if you know the root cause, please post it here as an answer. Thanks.