title: Best way to update the entity object from DTO object using Hibernate and Spring
body: <p>First to explain the context. I have backend Java (Spring/Hibernate) application that is accessible via Rest client. 
  Problem: Since API is exposed as RestApi, I get the DTO object from the client with ID of the entity which needs to be updated.</p>
  
  <p>Current approach: I am getting the entity from DB based on the ID, and detaching it from persistent context, converting DTO object to entity object,
  then sending it to DAO, where again I am fetching the entity from DB (as DAO can be called directly by other internal classes)  then again detaching it and later merge operations get called.
  So for every update call hibernate will fire 3 select statement and 1 update statement. Is there any way I can reduce the number of the select calls.</p>