Added a method to find the parent entity of a component.