db4o

A few questions about working with db4o

倾然丶 夕夏残阳落幕 提交于 2019-12-17 23:22:19
问题 I am trying the db4o object databse and so far I quite like what I am seeing, but I also read this post on stackoverflow db4o experiences? indicating that not everything that seems so easy is easy. Right now, I have some questions regarding on how db4o is used in real world apps. So if you have any experience in working (especially in web app context) with db4o, I would love to hear them. Here are my questions: How do you manage object identity when working with db4o stored objects?** Coming

What is the difference between graph-based databases and object-oriented databases?

余生颓废 提交于 2019-12-17 22:04:56
问题 What is the difference between graph-based databases (http://neo4j.org/) and object-oriented databases (http://www.db4o.com/)? 回答1: I'd answer this differently: object and graph databases operate on two different levels of abstraction. An object database's main data elements are objects, the way we know them from an object-oriented programming language. A graph database's main data elements are nodes and edges. An object database does not have the notion of a (bidirectional) edge between two

Conditional clauses for linq to Db4O query?

Deadly 提交于 2019-12-13 20:21:53
问题 In linq to sql i can do like this: var q = db.Colors; if(! string.IsNullOrEmpty(colorName)) q = q.Where(c=>c.Name.Equals(colorName)); return q.ToList(); In Db4O linq I can't do it like this because I have to start with var q = (from Color c in db select c); if(! string.IsNullOrEmpty(colorName)) q = q.Where(c=>c.Name.Equals(colorName)); return q.ToList(); This results in a complete enumeration of ALL the colors a filter by name. That's not the solution I was aiming for off course. Any

Storing an object containing a Calender object in a db4o local database, cannot retrieve object fields

烂漫一生 提交于 2019-12-12 20:24:48
问题 I have been storing an object which contains a GregorianCalendar object in a db4o database, which works just fine. However, on retrieving the object (after closing and re-opening the database), I cannot seem to access some of the information inside (namely get(GregorianCalendar.MONTH) ). I have included test code below, and am wondering how to fix this problem. import static org.junit.Assert.assertEquals; import java.util.GregorianCalendar; import org.junit.Test; import com.db4o.Db4oEmbedded;

Restrict child duplicates on creating object in db4o

半世苍凉 提交于 2019-12-12 04:17:43
问题 It's a very common situation, but I'm kinda new using ORM especially in Android, so your help would be awesome. Scope: Object, e.g. Message has primitive fields and field (child) of another object, e.g. Discussion. So it looks like: public class Message { private int id; private String text; private Discussion discussion; public Message(int id, String text, int discussionId){ this.id=id; this.text=text; discussion = new Discussion (discussionId); } } public class Discussion { private int id;

Db4o Client/Server Mode without persistent class : Unique Constraint / Indexes

谁都会走 提交于 2019-12-12 00:57:57
问题 It's not clear for me from the documentation if a db4o server in java without persistent class can handle unicity constraint, I see nothing saying no, but the way to configure it on the server we need the class on the classpath. (and I don't want that in that case). Same question for indexes ? Thanks in advance. 回答1: My recommendation: Don't do a db4o server without the persistent classes available. That leads to countless issues. Anyway, you should be able to just specify the full qualified

OutOfMemoryError caused when db4o databse has 15000+ objects

最后都变了- 提交于 2019-12-11 14:28:10
问题 I am using db4o 8.0. I have a class PostedMessage{ @Indexed long receivedTime; @Indexed long sentTime; ... //getter methods and setter methods for all the fields. } I persist the PostedMessage objects to db4o database. I have already saved 15000+ objects to db4o database. And now when I run following query, it results in OutOfMemoryError. //Query to get PostedMessages between "start" and "end" dates. Query q = db.query(); q.constrain(PostedMessage.class); Constraint from = q.descend(

Do I have to re-apply db4o configuration settings (and indexes) on each application run, or only on database creation?

青春壹個敷衍的年華 提交于 2019-12-11 07:08:07
问题 I'm in the process of evaluating db4o and I have a pretty simple question. Does the db4o configuration settings (e.g. Transparent Activation) and indexes need to be setup each time the application runs and/or the database is loaded, or can all this be setup at the time the database is created? For reference - I'm building an Android application and the database is going to be prebuilt on the desktop and shipped with the app. 回答1: just as an FYI, there is an exception .. indexes once created

db4o, how to update an object if a field was added?

瘦欲@ 提交于 2019-12-10 20:07:20
问题 How can I do this? I stored an object in db4o, e.g: class Person { string _name; int _age; } now, after hundrets of Persons stored in the db, I've added a new field: class Person { string _name; int _age; bool? _newField; } When I load the old classes with the new class, the _newField will be null or the default value. When I save it back to the db, the added field is obmitted. How can I update all existing objects with the new field? Is that possible? 回答1: As you said, when you add a new

How to create database using Db4o in android?

北战南征 提交于 2019-12-07 20:58:48
问题 I am developing an App in which now i have to create database for more better user experience. Then i came to know about DB4o which is many times faster tool for creating database than other like SQLite, MySql etc, but the problem is i am not able to find any single example that explains about DB4o and how to create database using Db4o. If anybody has used it, please post an example or send me link. 回答1: To store the object in database use db().store(exercise); To retrieve All records from