Reflection classes for databases