Fixed Repository::createEntity method to support single table inheritance