Storing a car-object in is very-different in SQLite and db4o.
ContentValues initialValues = new ContentValues(); initialValues.put("id", number); initialValues.put("name", "Tester"); initialValues.put("points", number); db.insert(DB_TABLE_PILOT, null, initialValues); initialValues = new ContentValues(); initialValues.put("model", "BMW"); initialValues.put("pilot", number); db.insert(DB_TABLE_CAR, null, initialValues);
Car car = new Car("BMW"); car.setPilot(new Pilot("Tester", points)); container.store(car);
You can see that db4o handles adding objects to the database in a much more elegant way - #store(object) method is enough. In SQLite case it is much more difficult as you mush store different objects into different tables. Some of the additional work that SQLite developer will have to do is not visible in this example, i.e: