Db4o currently knows three ways of creating and populating an object from the database. The approach to be used can be configured globally and on a per-class basis.
The most obvious way is to call an appropriate constructor. Db4o does;notrequire a public or no-args constructor. It can use any constructor that accepts default (null/0) values for all of its arguments without throwing an exception. Db4o will test all available constructors on the class (including private ones) until it finds a suitable one.
What if no such constructor exists?
Db4o can also bypass the constructors declared for this class using platform-specific mechanisms. (For Java, this option is only available on JREs >= 1.4.) This mode allows reinstantiating objects whose class doesn't provide a suitable constructor, However, it will (silently) break classes that rely on the constructor to be executed, for example in order to populate transient members.
If this option is available in the current runtime environment, it will be the default setting.
If none of the two approaches above is suitable, db4o provides a way to specify in detail how instances of a class should be stored and reinstantiated by implementing the Translator interface and registering this implementation for the offending class. Translators chapter cover this topic in detail.