title: What is a leaf entity in the inheritance hierarchy and what are examples of?
body: <p>The following was provided by <a href="https://www.doctrine-project.org/projects/doctrine-orm/en/2.9/reference/inheritance-mapping.html" rel="nofollow noreferrer">Inheritance Mapping - Doctrine</a> and was only modified to pertain to both STI and CTI.</p>
  <blockquote>
  <p>There is a general performance consideration with Single or Class
  Table Inheritance (STI or CTI): If the target-entity of a many-to-one
  or one-to-one association is a STI or CTI entity, it is preferable for
  performance reasons that it be a leaf entity in the inheritance
  hierarchy, (ie. have no subclasses). Otherwise Doctrine CANNOT create
  proxy instances of this entity and will ALWAYS load the entity
  eagerly.</p>
  </blockquote>
  <p>In addition to the Doctrine docs, <a href="https://stackoverflow.com/questions/17539361/what-is-a-leaf-entity">What is a leaf entity?</a> provides a similar description, however, I still don't have a clear enough understanding, and would like to see examples.</p>
  <p>Let's say I have entities <code>V8Engine</code>, <code>V6Engine</code>, and <code>Straight4Engine</code> which all extend <code>AbstractEngine</code>, and another entity <code>Automobile</code> where many automobiles have one engine (sorry for my fictional example and change if you think necessary).  Please describe what leaf entities are and provide an example of both where the target-entity is and is not a leaf entity.</p>