title: The target entity of the relationship attribute cannot be determined
body: <p>I can't figure out what the problem is, please help. I've searched a lot, but didn't find any useful advice. Maybe you can help me. Thanks a lot.</p>
  
  <p>There are two classes using eclipselink as jpa provider:</p>
  
  <pre><code>@Entity
  @Table(name = "USER")
  public class User {
  
      @Id
      @GeneratedValue(strategy = GenerationType.TABLE)
      private Long id;
  
      private String login;
  
      private Long groupId;
  
      private String email;
  
      @ManyToMany(mappedBy = "users")
      private List polls;
  
      @OneToMany(mappedBy = "user")
      private List votes;
  
      public List getVotes() {
          return votes;
      }
  
      public void setVotes(List votes) {
          this.votes = votes;
      }
  
      public User() {
      }
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      public String getLogin() {
          return login;
      }
  
      public void setLogin(String login) {
          this.login = login;
      }
  
      public Long getGroupId() {
          return groupId;
      }
  
      public void setGroupId(Long groupId) {
          this.groupId = groupId;
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
      public List getPolls() {
          return polls;
      }
  
      public void setPolls(List polls) {
          this.polls = polls;
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>@Entity
  @Table(name = "VOTE")
  public class Vote {
  
      @Id
      @GeneratedValue(strategy = GenerationType.TABLE)
      private Long vid;
  
      private String comment;
  
      @ManyToOne
      private User user;
  
      @ManyToOne
      private Option option;
  
      public Vote() {
      }
  
      public Long getVid() {
          return vid;
      }
  
      public void setVid(Long vid) {
          this.vid = vid;
      }
  
      @Column(name = "comment")
      public String getComment() {
          return comment;
      }
  
      public void setComment(String comment) {
          this.comment = comment;
      }
  
      public User getUser() {
          return user;
      }
  
      public void setUser(User user) {
          this.user = user;
      }
  
      public Option getOption() {
          return option;
      }
  
      public void setOption(Option option) {
          this.option = option;
      }
  
  }
  </code></pre>
  
  <p>When I'm trying to compile this, I receive error:</p>
  
  <pre><code>Exception [EclipseLink-7214] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: The target entity of the relationship attribute [votes] on the class [class logic.User] cannot be determined.  When not using generics, ensure the target entity is defined on the relationship mapping.
  </code></pre>
  
  <p>Here is my persistence.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="1.0"
      xmlns="http://java.sun.com/xml/ns/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_1_0.xsd"&gt;
      &lt;persistence-unit name="pollsPU" transaction-type="RESOURCE_LOCAL"&gt;
          &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;        
          &lt;class&gt;logic.Option&lt;/class&gt;
          &lt;class&gt;logic.Poll&lt;/class&gt;
          &lt;class&gt;logic.User&lt;/class&gt;
          &lt;class&gt;logic.Vote&lt;/class&gt;       
          &lt;class&gt;logic.Greeting&lt;/class&gt;       
          &lt;properties&gt;
              &lt;property name="eclipselink.jdbc.password" value="" /&gt;
              &lt;property name="eclipselink.jdbc.user" value="" /&gt;
              &lt;property name="eclipselink.jdbc.driver" value="com.mysql.jdbc.Driver" /&gt;
              &lt;property name="eclipselink.jdbc.url"
                  value="jdbc:mysql://localhost:3306/core_polls" /&gt;
              &lt;property name="eclipselink.ddl-generation" value="drop-and-create-tables" /&gt;
              &lt;property name="eclipselink.logging.level" value="INFO" /&gt;
              &lt;property name="eclipselink.ddl-generation.output-mode"
                  value="database" /&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>