1 Minute Tutorial

Here is a simple example to demonstrate how it is easy to persist objects with ODB. Here, a java instance is created, the ODB database is opened, the store method is called to save the object and then the database is closed.

The Sport Class has one String attribute called name.

// Create the instance be stored
Sport sport = new Sport("volley-ball");
 
// Open the database
ODB odb = ODBFactory.open("tutorial.odb");
 
// Store the object
odb.store(sport);
 
// Close ODB
odb.close();

Here is how the object is displayed if the ODB Explorer Meta Model View. This view shows all the classes descriptions that are stored in the database. At the right the object view showing the objects.

Meta Model & Object View

1mtutorial_img1.png

Table View

Here is how the object is displayed if the ODB Explorer Table View. The table view shows objects in ab SQL-like table result:

1mtutorial_img2.png

Object Introspector

here is how the object is displayed if the ODB Explorer Introspector View. This view, that displays all the attributes of the object, permits updating fields value manually:

1mtutorial_img3.png

If you want to learn more about NeoDatis ODB, click here to have a look at the 5 minutes tutorial or here to download the full documentation in PDF format.

You can also diectly download the full ODB package that comes with the documentation here

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License