Hibernate persistent entity should have a primary key
<p>I'm having the following Entity. I'm trying to replace the folliwing. (See image) but I'm getting the following error: Persistent Entity should have a primary key. </p>

<p>(I'm new to hibernate) (Please comment if you also need the UserEntity Class) (Thanks in advance!)</p>

<p><a href="https://i.stack.imgur.com/vExAa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vExAa.png" alt="enter image description here"></a></p>

<pre><code>@Entity
@Table(name = "Student", schema = "pad_ijburg", catalog = "")
public class StudentEntity extends UserEntity {
    private Integer idGroup;
    private int idUser;

    @Basic
    @Column(name = "idGroup")
    public Integer getIdGroup() {
        return idGroup;
    }

    public void setIdGroup(Integer idGroup) {
        this.idGroup = idGroup;
    }

    @Basic
    @Column
    public int getIdUser() {
        return idUser;
    }

    public void setIdUser(int idUser) {
        this.idUser = idUser;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        StudentEntity that = (StudentEntity) o;

        if (idUser != that.idUser) return false;
        if (idGroup != null ? !idGroup.equals(that.idGroup) : that.idGroup != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = idGroup != null ? idGroup.hashCode() : 0;
        result = 31 * result + idUser;
        return result;
    }
}

package org.hva.folivora.model.user;

import javax.persistence.*;

/**
 * 
 */
@Entity
@Table(name = "User", schema = "pad_ijburg")
@Inheritance(strategy = InheritanceType.JOINED)
public class UserEntity {
    private int idUser;
    private String email;
    private String firstName;
    private String lastName;
    private String password;
    private Boolean admin;

    @Id @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "idUser", nullable = false)
    public int getIdUser() {
        return idUser;
    }

    public void setIdUser(int idUser) {
        this.idUser = idUser;
    }

    @Basic
    @Column(name = "email")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "firstName")
    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    @Basic
    @Column(name = "lastName")
    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    @Basic
    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "admin")
    public Boolean getAdmin() {
        return admin;
    }

    public void setAdmin(Boolean admin) {
        this.admin = admin;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserEntity that = (UserEntity) o;

        if (idUser != that.idUser) return false;
        if (email != null ? !email.equals(that.email) : that.email != null) return false;
        if (firstName != null ? !firstName.equals(that.firstName) : that.firstName != null) return false;
        if (lastName != null ? !lastName.equals(that.lastName) : that.lastName != null) return false;
        if (password != null ? !password.equals(that.password) : that.password != null) return false;
        if (admin != null ? !admin.equals(that.admin) : that.admin != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = idUser;
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (firstName != null ? firstName.hashCode() : 0);
        result = 31 * result + (lastName != null ? lastName.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (admin != null ? admin.hashCode() : 0);
        return result;
    }
}
</code></pre>

<p>Edit: Also getting the following error when using generated value identiti</p>

<pre><code>.StudentEntity column: idUser (should be mapped with insert="false" update="false")
</code></pre>