DB4O Community Edition 8.1.3 release, object-oriented database

Db4o is an object-oriented database, it can be persistent, such as tree structure of the complex object,
and using the local data query language,
to support single-user mode, multi-user mode. Community upgrade to the full support of Linux.

Examples of use

initialization

import com.db4o.cs.Db4oClientServer;
public class Node {
  public String name;
  public Node Left;
  public Node Right;
}
String dbname = "node.db";
var cfg = Db4oClientServer.newServerConfiguration();
cfg.common().objectClass(Node.class).cascadeOnActivate(true);
cfg.common().objectClass(Node.class).cascadeOnUpdate(true);
cfg.common().objectClass(Node.class).cascadeOnDelete(true);
cfg.common().objectClass(Node.class).callConstructor(true);
//Port=0, Local Server.
try (var server = Db4oClientServer.openServer(cfg, dbname, 0)) {
  ...
}

 

Insert Object

try (var oc = server.openClient()) {
  Node root = new Node();
  root.name = "Root";

  root.Left = new Node();
  root.Left.name = "Left";

  root.Right = new Node();
  root.Right.name = "Right";

  root.Right.Right = new Node();
  root.Right.Right.name = "Right.Right";
  oc.store(root);
  oc.commit();
}

 

Use the query object templates non-null, non-zero data

try (var oc = server.openClient()) {
  Node qo = new Node();
  qo.name = "Root";
  var ns = oc.queryByExample(qo);
  var root = ns.next();
  System.out.println(root.Right.Right.name);
}

 

Java-style inquiry

import com.db4o.query.Predicate;
try (var oc = server.openClient()) {
  List<Node> ns = oc.query(new Predicate<Node>() {
    @Override
    public boolean match(Node n) {
      return n.name.equals("Root");
    }
  });
  Node root = ns.get(0);
  System.out.println(root.Right.Right.name);
}

 

The underlying query, the query may be appropriate to develop a custom device

try (var oc = server.openClient()) {
  var q = oc.query();
  q.constrain(Node.class);
  q.descend("name").constrain("Root").equal();
  var ns = q.execute(Node.class);
}


This version of a comprehensive upgrade to the object manager under Linux . Direct download .

There are high-definition big picture,
https://iboxdb.github.io/db4o-gpl-doc/images/db4o_java_gpl.png


 

https://iboxdb.github.io/db4o-gpl-doc/images/db4o_gpl.png

https://iboxdb.github.io/db4o-gpl-doc/images/tree.png

 

Db4o community version of the code download.
 

product comparison:

Db4o operation for object-oriented structure, provides a graphical interface to query the data.
iBoxDB for high-performance, high-concurrency, data security needs of space applications.

 

Guess you like

Origin www.oschina.net/news/109924/db4o-8-1-3-released