org.hibernate.AnnotationException: mappedBy reference an unknown target entity property
<p>I am trying to make a OneToMany relationship between User and Project but I am getting following error: </p>

<pre><code>org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: ProjectDTO.FKUser in UserDTO.projectDTOs
</code></pre>

<p>My User class look like below</p>

<pre><code>@Entity
@Table(name = "USER")
public class UserDTO implements java.io.Serializable {

    private Integer iduser;
    private Set&lt;ProjectDTO&gt; projects = new HashSet&lt;ProjectDTO&gt;(0);;

    public UserDTO() {
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "IDUser", unique = true, nullable = false)
    public Integer getIduser() {
        return this.iduser;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "FKUser")
    public Set&lt;ProjectDTO&gt; getProjectDTOs() {
        return projects;
    }

}
</code></pre>

<p>And my Project class looks like</p>

<pre><code>@Entity
@Table(name = "Project")
public class ProjectDTO implements java.io.Serializable {

    private Integer idproject;
    private UserDTO FKUser;

    public ProjectDTO() {
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)

    @Column(name = "IDProject", unique = true, nullable = false)
    public Integer getIdproject() {
        return this.idproject;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "FKUser", referencedColumnName = "IDUser")
    public UserDTO getUserDTO() {
        return FKUser;
    } 
}
</code></pre>

<p>I went through some similar questions but I was unable to figure out where I was going wrong. Maybe I am missing something very obvious. </p>

<p>Thanks a lot</p>