Hmm I should probably add an exception id the class `$def->factory->entity` does not exist.