Base classes for database