title: Why is ID not set in entity returned from spring-data-jpa save
body: <p>I have a simple entity.  I'm using spring-data-jpa version 1.2.0.RELEASE and eclipselink 2.4.1.</p>
  
  <pre><code>@Entity
  @Table(name="platform")
  public class Platform {
  
      @Id
      @Column(name="id", nullable=false, updatable=false, insertable=true)
      private Long id;
      // etc.
  }
  </code></pre>
  
  <p>I want to save it. My repository looks like</p>
  
  <pre><code>public interface PlatformRepository extends JpaRepository&lt;Platform, Long&gt; {
  
      Platform findByName( String name );
  }
  </code></pre>
  
  <p>My Controller is very simple with this method</p>
  
  <pre><code>@RequestMapping(method=RequestMethod.POST, produces="application/json")
  public Platform post( Platform platform ) {
      Platform result = platformDao.saveAndFlush(platform);
      return result;
  }
  </code></pre>
  
  <p>And the response from that method is </p>
  
  <pre><code>{"platform":{"id":null,"name":"Test1"}}
  </code></pre>
  
  <p>Select * from platform shows that Test1 has an ID of 6.  The table is defined as:</p>
  
  <pre><code>create table platform(
  id int not null auto_increment primary key,
  name varchar(128) not null);
  </code></pre>
  
  <p>I expect the ID to be set after the save, but it isn't. They're not expecting me to do a lookup immediately after writing the entity, right?</p>