Cayenne User Documentation
DataContextFactory

To customize how the DataContext is built, an optional DataContextFactory can be registered with DataDomain in the Modeler. The class name you enter must implement org.apache.cayenne.access.DataContextFactory interface. If a factory is entered, Cayenne will use it in all places where the DataContext is created. A single factory instance is reused for the life of the DataDomain.

.