[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Assembly: Db4objects.Db4o (in Db4objects.Db4o.dll)
turns on storing static field values for this class.
Namespace: Db4objects.Db4o.Config
Assembly: Db4objects.Db4o (in Db4objects.Db4o.dll)
Syntax
Visual Basic (Declaration) |
---|
Sub PersistStaticFieldValues |
C# |
---|
void PersistStaticFieldValues () |
Visual C++ |
---|
void PersistStaticFieldValues () |
Remarks
turns on storing static field values for this class.
By default, static field values of classes are not stored to the database file. By turning the setting on for a specific class with this switch, all non-simple-typed static field values of this class are stored the first time an object of the class is stored, and restored, every time a database file is opened afterwards, after class meta information is loaded for this class (which can happen by querying for a class or by loading an instance of a class).
To update a static field value, once it is stored, you have to the following in this order:
(1) open the database file you are working agains
(2) make sure the class metadata is loaded
(3) change the static member
(4) store the static member explicitely
The setting will be ignored for simple types.
Use this setting for constant static object members.
This option will slow down the process of opening database files and the stored objects will occupy space in the database file.
By default, static field values of classes are not stored to the database file. By turning the setting on for a specific class with this switch, all non-simple-typed static field values of this class are stored the first time an object of the class is stored, and restored, every time a database file is opened afterwards, after class meta information is loaded for this class (which can happen by querying for a class or by loading an instance of a class).
To update a static field value, once it is stored, you have to the following in this order:
(1) open the database file you are working agains
(2) make sure the class metadata is loaded
![]() | |
---|---|
objectContainer.query().constrain(Foo.class); // Java |
![]() | |
---|---|
objectContainer.Query().Constrain(typeof(Foo)); // C# |
(3) change the static member
(4) store the static member explicitely
![]() | |
---|---|
objectContainer.set(Foo.staticMember); // C# |
The setting will be ignored for simple types.
Use this setting for constant static object members.
This option will slow down the process of opening database files and the stored objects will occupy space in the database file.