The entity has no primary key attribute defined
<p>I'm new to JPA and I have been struggling with this error for some time now. Eclipse is "saying" that my entity does not have a primary key defined, but I read a bunch of tutorials and this is the way that they all do it.</p>

<p>Example: <a href="https://en.wikibooks.org/wiki/Java_Persistence/Identity_and_Sequencing#Example_embedded_id_XML" rel="nofollow noreferrer">https://en.wikibooks.org/wiki/Java_Persistence/Identity_and_Sequencing#Example_embedded_id_XML</a></p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;entity-mappings version="1.0"
        xmlns="http://java.sun.com/xml/ns/persistence/orm"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"&gt;

        &lt;entity name="BefriendableUser" class="com.projects.socialconnections.befriendableuser.BefriendableUser" access="FIELD"&gt;
            &lt;embedded-id class="com.projects.socialconnections.befriendableuser.BefriendableUserId"/&gt;   
        &lt;/entity&gt;

        &lt;embeddable name="BefriendableUserId" class="com.projects.socialconnections.befriendableuser.BefriendableUserId" access="FIELD"&gt;
                &lt;attributes&gt;
                    &lt;basic name="numId"&gt;
                        &lt;column name="befriendable_user_id" /&gt;
                    &lt;/basic&gt;
                &lt;/attributes&gt;
        &lt;/embeddable&gt;

&lt;/entity-mappings&gt;
</code></pre>