Add relationship method to ClassInfo class.