Open topic with navigation
Type Handling
db4o tries to be simple an easy to use. A big part of this is to transparently store any object without any complex mapping or configuration. Storing an object correctly is a complex process and heavily depends on the type of the object. db4o has different storing strategies for different types.
Supported Types
For most types the regular db4o type handling is sufficient. You can store objects composed of following types:
- All basic numeric types like ints, bytes, floats, doubles etc (and their wrapper types).
- Strings
- Arrays
- Dates
- Enums
- Basic collections like ArrayLists and HashMaps.
- UUIDs and BigMath types after adding the appropriate configuration item.
- Any class type which you've build with yourself with the types above.
Types Which Should Not Be Stored
These kind of types shouldn't be stored without any special treatment:
- Any type from the JDK / .NET Framework, library or framework. As long as you don't have control over the implementation of a type you cannot be sure how and what exactly is stored.
- This is also true for collections with sophisticated behavior like ConcurrentMaps or WeakHashmaps.
Control Persistence
If you need more control on how a object is persisted, then you can do that with object translators and type handlers.