项目作者: KerlinMichel

项目描述 :
An Object Relational Database
高级语言: Java
项目地址: git://github.com/KerlinMichel/BalloonDB.git
创建时间: 2016-11-12T01:35:20Z
项目社区:https://github.com/KerlinMichel/BalloonDB

开源协议:Other

下载


Build Status

BalloonDB :balloon:

BalloonDB is an object relational database. It is build on Java and it follows the ideas of object orient programming.

How to add a client-side Database for devs

  1. package bdb.demo;
  2. import balloondb.DataObject;
  3. /* BalloonDB only accepts DataObjects to ensure
  4. that the class is serializable and have other
  5. necessary features such as a key.
  6. */
  7. public class CustomObject extends DataObject {
  8. String name;
  9. double id;
  10. public CustomObject(String name, double id) {
  11. this.name = name;
  12. this.id = id;
  13. }
  14. }
  1. CustomObject obj1 = new CustomObject("Some-name", 15.2D);
  2. CustomObject obj2 = new CustomObject("Diff-name", 45D);
  3. BalloonDB bdb = new BalloonDB(new File("/Test"));
  4. bdb.insert(obj1);
  5. bdb.insert(obj2);
  6. bdb.forceSave();
  7. bdb.select("CustomObject where name = \"Some-name\"");
  8. bdb.delete("CustomObject where id = 45");

The physical file will be save in /Test followed by the class path, in this case /bdb/demo, and the file name with by an auto-generated UUID. So it will under /Test/bdb/demo/{some UUID}.ser