title: JPA EntityManager find method returns proxy
body: <p>I have two entities. One inherited from the other.</p>
  
  <p>Example:</p>
  
  <pre><code>@Entity
  @Table(name = "vehicle")
  @Inheritance(strategy = InheritanceType.JOINED)
  public class VehicleEntity {
      //id, etc., all reference fetch type is LAZY
  }
  
  @Entity
  @Table(name = "car")
  public class CarEntity extends VehicleEntity {
      //special parameters, all reference fetch type is LAZY
  }
  </code></pre>
  
  <p>When I call a find() on EntityManager with an existing car's id like this:</p>
  
  <pre><code>VehicleEntity vehicleEntity = entityManager.find(VehicleEntity.class, carID);
  </code></pre>
  
  <p>I get back a proxy object, but I need to access the special methods of the CarEntity class, because I would like to set some new parameters.</p>
  
  <p>Can someone help me how can I do this?</p>
  
  <p>Of course this is just an example problem. More specifically: after I call find I'm checking the instance of the returned object, if it is "CarEntity" I set the parameters, if not I don't do anything. I have much more inherited classes beside "CarEntity", and I do the same procedure like before. I know I could solve this with "find"s on the specific object classes, but then I have to call "find" several times, and when I'm looking for any "VehicleEntity" I'm always interested in the actual object so the best would be a global solution.</p>