title: EclipseLink JPA Object is not a known entity type
body: <p>I have a strange problem with eclipseLink and an object which I want to persist. I have one Object (KeypointListImpl) that stores another object KeypointImpl in a List. Persisting a keypointImpl objects works great but if I try to persist a keypointListImpl object I get an java.lang.IllegalArgumentException that says the object keypointImpl isn't a known entity type.</p>
  
  <p>Here is the KeypointImpl Code:</p>
  
  <pre><code>@Entity
  @Table(name="Keypoints")
  public class KeypointImpl implements Keypoint {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int id;
      @Enumerated(EnumType.STRING)
      private DetectorType keypointType;
      private float x;
      private float y;
      private float size;
      private float angle;
      private float response;
      private int octave;
      private int classId;
      ...
  }
  </code></pre>
  
  <p>Here is the KeypointListImpl Code:</p>
  
  <pre><code>@Entity
  @Table(name="KeypointLists")
  public class KeypointListImpl implements KeypointList {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int id;
      @OneToOne(cascade={CascadeType.ALL}, targetEntity=KeypointImpl.class)
      private List&lt;Keypoint&gt; keypoints;
      ...
  }
  </code></pre>
  
  <p>Here is the mains content:</p>
  
  <pre><code>    Keypoint kp1 = new KeypointImpl(DetectorType.FAST, 5, 5, 10, 90, 2, 3, 0);
      Keypoint kp2 = new KeypointImpl(DetectorType.FAST, 6, 6, 3, 45, 1, 2, 1);
  
      em.persist(kp1);
      em.persist(kp2);
  
      List&lt;Keypoint&gt; keypoints = new ArrayList&lt;Keypoint&gt;();
      keypoints.add(kp1);
      keypoints.add(kp2);
  
      KeypointList keypointlist = new KeypointListImpl();
      keypointlist.setKeypointList(keypoints);
  
      em.persist(keypointlist);
  </code></pre>
  
  <p>The tables that are constructed look fine. I get a KeypointsLists(ID, KEYPOINTS_ID) and a Keypoints(..., ...) table.</p>
  
  <p>Can anyone point me to my error please?! :-)</p>
  
  <p>As requested the persistence.xml as well</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
      version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"&gt;
  
      &lt;persistence-unit name="AudiModelRecognition" transaction-type="RESOURCE_LOCAL"&gt;
  
          &lt;class&gt;amr.model.KeypointImpl&lt;/class&gt;
          &lt;class&gt;amr.model.KeypointListImpl&lt;/class&gt;
  
          &lt;properties&gt;
              &lt;property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /&gt;
              &lt;property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/amr" /&gt;
              &lt;property name="javax.persistence.jdbc.user" value="arm" /&gt;
              &lt;property name="javax.persistence.jdbc.password" value="..." /&gt; 
  
              &lt;!-- EclipseLink should create the database schema automatically --&gt;
              &lt;property name="eclipselink.ddl-generation" value="create-tables" /&gt;
              &lt;property name="eclipselink.ddl-generation.output-mode" value="database" /&gt;
          &lt;/properties&gt;
  
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>