File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,23 +61,23 @@ class Person:
6161
6262### Using ObjectBox
6363
64- To actually use the database, you launch (or "build") it with the model you've just defined.
65- Afterwards, you can reuse the instance (` ob ` in the example below) and use it to access "Entity Boxes" which hold your objects.
64+ To actually use the database, you create a Store with the model you've just defined.
65+ Afterwards, you can reuse the instance (` store ` in the example below) and use it to access "Entity Boxes" which hold your objects.
6666
6767#### program.py
6868
6969``` python
7070import objectbox
7171# from mypackage.model import Person
7272
73- # Configure ObjectBox: should be done only once in the whole program and the "ob " variable should be kept around
73+ # Configure ObjectBox: should be done only once in the whole program and the "store " variable should be kept around
7474model = objectbox.Model()
7575model.entity(Person, last_property_id = objectbox.model.IdUid(10 , 1010 ))
7676model.last_entity_id = objectbox.model.IdUid(1 , 1 )
77- store = objectbox.Store(model = model, directory = " db " )
77+ store = objectbox.Store(model = model)
7878
7979# Open the box of "Person" entity. This can be called many times but you can also pass the variable around
80- box = objectbox.Box(ob, Person)
80+ box = store.box( Person)
8181
8282person = Person()
8383person.name = " Joe Green"
You can’t perform that action at this time.
0 commit comments