db4o Developer Community
Developer Community db4o open source object database, native to Java and .NET
Register   |  Login
  Search
  • Forums
  • Documentation
  • Resources
  • Downloads
  • Blogs
  • About
Unanswered Active Topics Forums
Forums > Non-English-Language Forums > Chinese
很奇怪的问题,不知道是不是Bug
Last Post 08 Jan 2010 07:14 AM by Animax. 2 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
hooke
New Member
New Member
hooke

--
28 Oct 2009 09:30 AM  

我有一个类Expense,其中有个属性Account的类型为IAccount接口类型,CreditCard继承自IAccount,然后我用如下代码:

Expense ex = new Expense()

ex.Account = new CreditCard();

db.Store(ex);

这样的话,在数据库中查看Expense的对象,其Account属性是有值的

但如果我将Account的属性的类型设为Account抽象类,CreditCard也改为继承为Account,结果Expense对象中Account的值为null。我不知道我为什么

另外,如果我将Expense所有的对象删除,类也去掉,结果数据库还会有这个类,这不是成为垃圾了吗

mark09
New Member
New Member
mark09

--
10 Nov 2009 01:17 AM  

在搜索引擎营销基本和标准的方法是搜索引擎优化。 Netex解决方案为您提供最佳的商业解决方案的工作正是在这些原则。

学习的网络营销战略的最重要因素之一是教育统筹局局长,搜索引擎营销。良好的扫描电镜可以帮助您实现在主要搜索从而帮助疏导交通的目标Web引擎排名第一,以找到您的网站很容易。  sydney seo

Animax
New Member
New Member
Posts:4
Animax

--
08 Jan 2010 07:14 AM  

配置存储的深度问题

 或者你可以在打开DB4O文件之前写上:

                Db4oFactory.Configure().ObjectClass(typeof(Expense)).CascadeOnUpdate(true);

                Db4oFactory.Configure().ObjectClass(typeof(Expense)).CascadeOnActivate(true);

                Db4oFactory.Configure().ObjectClass(typeof(Expense)).CascadeOnDelete(true); 

 

 

You are not authorized to post a reply.
Forums > Non-English-Language Forums > Chinese

Active Forums 4.2
Close
Copyright ©2000-2010 by Versant Corp.
Privacy Policy