title: Play 2.0.4 Problems updating a class that uses @EmbeddedId
body: <p>I’ve recently come across a problem with a class that has an embedded id.  Whenever I want to update an existing entry in the database, I get the error “<code>java.lang.RuntimeException: No @javax.persistence.Id field found in class</code>”. I only get this error, when I use <code>update()</code> or <code>save()</code> on an object that's already an exciting db entry. Using <code>save()</code> to insert a new entry, works without a problem and so does deleting an existing entry with <code>delete()</code>. </p>
  
  <p>Someone else posted a question about this problem in the Play Framework Google Group, but sadly it never got answered. So I thought I'd try asking for help here.</p>
  
  <p>Here's how my code basically looks:</p>
  
  <pre><code>@Entity
  @Table(name = "files_location")
  public class FilesLocation extends Model {
  
      @EmbeddedId
      public FilesLocationPK ids;
  
      @Column(name="status")
      public Character status; 
  
      @ManyToOne
      @MapsId("fileId")
      @JoinColumn(name = "file_id", referencedColumnName = "id", insertable = false, updatable = false)
      public File file;
  
      @ManyToOne
      @MapsId("locationId")
      @JoinColumn(name = "location_id", referencedColumnName = "id", insertable = false, updatable = false)
      public Location location;
  
  }
  
  
  
  @Embeddable
  public class FilesLocationPK {
  
      @Column(name="file_id")
      public Integer fileId;
  
      @Column(name="location_id")
      public Integer locationId;
      ...
  }
  </code></pre>
  
  <p>The Error looks like this:</p>
  
  <pre><code>java.lang.RuntimeException: No @javax.persistence.Id field found in class [class models.FilesLocation]
      at play.db.ebean.Model._idAccessors(Model.java:39)
      at play.db.ebean.Model._getId(Model.java:52)
      at play.db.ebean.Model.hashCode(Model.java:183)
      at java.lang.Object.toString(Object.java:219)
      at java.text.MessageFormat.subformat(Unknown Source)
      at java.text.MessageFormat.format(Unknown Source)
      at java.text.Format.format(Unknown Source)
      at java.text.MessageFormat.format(Unknown Source)
      at com.avaje.ebeaninternal.server.core.Message.msg(Message.java:39)
      ...
  </code></pre>