In Core Data, you can specify a custom subclass of NSManagedObject for a given entity by defining it in the data model file. BaseTen also supports mapping entities to custom subclasses of BXDatabaseObject, but since there is no model file to store these mappings in, they have to be specified in code or by using the Interface Builder attributes inspector on a BXSynchronizedArrayController.

In Interface Builder

Specify the custom class name in the "Class Name" field of the Attributes pane of a BXSynchronizedArrayController.

Manually

A BXEntityDescription is used when fetching or creating objects with the database context. In addition to the database URI, table and schema names, the entity description includes the table-to-custom-class mapping. You can change the mapping from the default of BXDatabaseObject to something else like this:

    BXEntityDescription* entity = [ctx entityForTable: @"test" error: NULL];
    [entity setDatabaseObjectClass: [Test class] error: NULL];

Since the BXEntityDescription class only creates new entity description instances once for each unique table, doing this once anywhere in your code will cause all subsequently created or fetched objects to be of the class you specified.