title: REST - Returning Created Object with Spring MVC
body: <p>I have a REST call that accepts a JSON object, lets say, a person. After I create this object (validated and saved to the database), I need to return the newly created JSON Object.</p>
  <p>I think the standard practice is to return <code>201 Accepted</code> instead of returning the object immediately. But my application needs the newly created object immediately.</p>
  <p>I have a controller methods that take a POST call, calls a service class, which in turn calls a DAO that uses Hibernate to create the object. Once it's saved to the database, I am calling another controller method that takes the ID of the person and returns the Object.</p>
  <p>My question, is this the better approach? i.e., calling another Controller method to get the newly created object. Or the POST call itself should return the Object.</p>
  <p><strong>The main question is:</strong>
  Calling another method takes a round trip and I guess it's an overkill. (Service-&gt;DAO-&gt;Hibernate-&gt;Database). Instead I think I should get the Object from the database immediately after it's saved in the same call (from the method that handled POST).</p>
  <p>What is the architecture standard here?</p>