db4o

Best practice for adding a bidirectional relation in OO model

青春壹個敷衍的年華 提交于 2019-12-03 09:15:37
问题 I'm struggling to come up with a good way of adding a bidirectional relation in OO model. Let's say there is a Customer who can place many Orders, that is to say there is a one-to-many association between Customer and Order classes that need to be traversable in both directions: for a particular customer it should be possible to tell all orders they have placed, for an order it should be possible to tell the customer. Here is a snippet of Java code, although the question is largely language

How to design many-to-many relationships in an object database?

非 Y 不嫁゛ 提交于 2019-12-03 07:19:06
问题 I thought it was about time to have a look at OO databases and decided to use db4o for my next little project - a small library. Consider the following objects: Book, Category. A Book can be in 0-n categories and a Category can be applied to 0-m Books. My first thought is to have a joining object such as BookCatecory but after a bit of Googling I see that this is not appropriate for 'Real OO'. So another approach (recommended by many) is to have a list in both objects: Book.categories and

Getting Started with Sharpen in Eclipse

匿名 (未验证) 提交于 2019-12-03 02:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm a .Net developer and recently I've become part of a project that is doing a port of some java software. I'm trying to get Sharpen up and running to convert. I have downloaded and installed Eclipse IDE for Java Developers (Version: Helios Service Release 1 Build id: 20100917-0705). I've been trying to follow this Guide . Following instructions on how to set up sharpen, I've tried then to grab a copy of the sharpen repo at https://source.db4o.com/db4o/trunk/sharpen/ from within eclipse. Host: source.db4o.com, Repository Path: source.db4o

Best practice for adding a bidirectional relation in OO model

微笑、不失礼 提交于 2019-12-02 23:37:21
I'm struggling to come up with a good way of adding a bidirectional relation in OO model. Let's say there is a Customer who can place many Orders, that is to say there is a one-to-many association between Customer and Order classes that need to be traversable in both directions: for a particular customer it should be possible to tell all orders they have placed, for an order it should be possible to tell the customer. Here is a snippet of Java code, although the question is largely language-agnostic: class Customer { private Set orders = new HashSet<Order> (); public void placeOrder (Order o)

Real World Experience of db4o and/or Eloquera Database

偶尔善良 提交于 2019-12-02 23:28:27
I am evaluating two object databases, db4o ( http://www.db4o.com ) and Eloquera Database ( http://eloquera.com ) for a coming project. I have to choose one. My basic requirement is scalability, multi user support and easy type evolution for RAD. Please share your real world experience. If you have both, can you compare these two? Which do you prefer? For the last 2 years I've been using DB4O, and I'm now switching to Eloquera. My reasons, in order: I'm building a commercial product, and the royalty based licensing on DB4O is WAY to high; DB4O said we could "talk about it", but I'm a very small

How to design many-to-many relationships in an object database?

五迷三道 提交于 2019-12-02 21:59:44
I thought it was about time to have a look at OO databases and decided to use db4o for my next little project - a small library. Consider the following objects: Book, Category. A Book can be in 0-n categories and a Category can be applied to 0-m Books. My first thought is to have a joining object such as BookCatecory but after a bit of Googling I see that this is not appropriate for 'Real OO'. So another approach (recommended by many) is to have a list in both objects: Book.categories and Category.books. One side handles the relationship: Book.addCategory adds Category to Book.categories and

can't locate db4o database file

一个人想着一个人 提交于 2019-12-02 19:27:30
问题 Hello I'm coding a simple CRUDE application that runs perfectly using JSF and DB4O. I can add and list all the entities normally without errors. I've used this code to persist the entities bd = Db4oEmbedded.openFile(configuration, "db.data"); bd.store(client); bd.commit(); the problem is that I cant locate the db.data file. I,ve done a search in the whole PC and still cant find it. soo where DB4O store those entities, how is it possible?? thank you. 回答1: It must be in your project execution

can't locate db4o database file

蓝咒 提交于 2019-12-02 08:46:23
Hello I'm coding a simple CRUDE application that runs perfectly using JSF and DB4O. I can add and list all the entities normally without errors. I've used this code to persist the entities bd = Db4oEmbedded.openFile(configuration, "db.data"); bd.store(client); bd.commit(); the problem is that I cant locate the db.data file. I,ve done a search in the whole PC and still cant find it. soo where DB4O store those entities, how is it possible?? thank you. It must be in your project execution path. Usually db4o file name is called with extension yap . Better you can use relative path to the database

Is it OK to open a DB4o file for query, insert, update multiple times?

百般思念 提交于 2019-12-01 08:16:10
问题 This is the way I am thinking of using DB4o. When I need to query, I would open the file, read and close: using (IObjectContainer db = Db4oFactory.OpenFile(Db4oFactory.NewConfiguration(), YapFileName)) { try { List<Pilot> pilots = db.Query<Pilot>().ToList<Pilot>(); } finally { try { db.Close(); } catch (Exception) { }; } } At some later time, when I need to insert, then using (IObjectContainer db = Db4oFactory.OpenFile(Db4oFactory.NewConfiguration(), YapFileName)) { try { Pilot pilot1 = new

利用db4o简化对象存储

夙愿已清 提交于 2019-12-01 04:11:35
db4o 是一款优秀的面向对象数据库, German Viscuso最近在DZone上发表了一篇介绍它的文章,该文可以视为是db4o在主要语言和框架中的一次巡演 。 作为一个关注Groovy的站点,我们的兴趣当然是其中和Groovy相关的部分:“在Giffon框架中使用db4o”。在这一小节,作者向读者展示了Griffon的db4o插件。 在Griffon工程中安装db4o插件后,会产生两个文件:Db4oConfig.groovy,包含数据源的定义;BootstrapDb4o.groovy,类似Grails中的BootStrap.groovy。同时,对于控制器,会注入一个名为withDb4o的动态方法,让你可以访问com.db4o.ObjectContainer实例,通过该对象你可以对数据库进行操作。 简单的例子由3部分组成: 领域类: class Person { int id String name String lastname } 在BootstrapDb4o.groovy中初始化数据: class BootstrapDb4o { def init = { db4o -> db4o.store(new Person(id: 1, name: "Danno" , lastname: "Ferrin")) db4o.store(new Person(id: 2, name: