Storing objects persistently
The persistent store lets you save objects to persistent memory. The objects are retained in memory after a BlackBerry smartphone restarts. The persistent store is included in all versions of BlackBerry Device Software.
With the Persistent Store API, you can save entire Java objects to memory without having to serialize the data first. When your app starts, it can retrieve the Java object from memory and process the data. The Persistent Store API does not provide a relational database model. You must create an effective object model and manage the relationships between objects, as necessary, using indices and hash tables.
The Persistent Store API is implemented in the PersistentObject class, PersistentStore class, and EventLogger class, all of which are provided in the net.rim.device.api.system package, and the Persistable interface, which is provided in the net.rim.device.api.util package.
Data is stored as instances of PersistentObject. PersistentObject can be any object that implements the Persistable interface. The Persistent Store API allows the implicit persistence of classes, so the following data types automatically implement the Persistable interface and can also be stored in the persistent store:
The storage for each app is distinct because each object in the persistent store is associated with a 64-bit ID (type long).