You are here: Advanced Features > Defragment > Defragmentation Configuration > Class Filter

Class Filter

db4o stores meta data about all classes used in the database . Even when the class doesn't exist anymore the meta-data in db4o is still there. The class filter allows you to remove class-meta data from the defragmented database. You can pass you own implementation of a class filter. Or you can use the built in AvailableTypeFilter. This filter removes all meta-data of classes which aren't present anymore.

DefragmentConfig config = new DefragmentConfig("database.db4o");
config.StoredClassFilter(new AvailableTypeFilter());

Defragment.Defrag(config);
DefragmentationConfigurationExamples.cs: Use class filter
Dim config As New DefragmentConfig("database.db4o")
config.StoredClassFilter(New AvailableTypeFilter())

Defragment.Defrag(config)
DefragmentationConfigurationExamples.vb: Use class filter