Note. It is persisted (saved) in the database and contains all data that is part of a note, like an id, note text and the creation date.
MyObjectBox.java, and some other classes used by ObjectBox internally.
MyObjectBox.kt, and some other classes used by ObjectBox internally.
pub run build_runner buildafter making any changes to the entity classes. ObjectBox generator will look for all
@Entityannotations in your
libfolder and create a single database definition
lib/objectbox-model.jsonand supporting code in
objectbox-model.jsoninto your source control (e.g. git) and add
objectbox.g.dartto the ignore list (e.g. .gitignore), otherwise, the build_runner will complain about it being changed each time you pull a change.
Box<Note>provides database operations for
addNote()is called. There, a new
Noteobject is created and put into the database using the
Noteobject), is assigned by ObjectBox during
remove()to achieve this:
Queryinstance is built once:
put()again with the changed object: