title: jpa error uses a non-entity [class ch.printsoft.mailhouse.usermgr.entity.Department] as target entity in the relationship attribute
body: <p>I try to persist my <code>Department</code> and <code>Mandator</code> classes to hsqhldb but it gives this error.</p>
  
  <pre><code>Exception Description: [class ch.printsoft.mailhouse.usermgr.entity.Mandator] uses a non-entity [class ch.printsoft.mailhouse.usermgr.entity.Department] as target entity in the relationship attribute [field departments].
  at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:126)
  at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:115)
  at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
  at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
  </code></pre>
  
  <p>These are the classes that I try to persist to my database. I really don't know what the problem is.</p>
  
  <pre><code>@Entity
  public class Mandator {
    @Id
    @GeneratedValue
    private Integer id;
    private String mandatorId;
    @OneToMany(mappedBy = "mandator")
    private List&lt;MandatorUser&gt; mandatorUsers;
    @OneToMany(mappedBy = "mandator")
    private List&lt;SLAFamilyGroup&gt; slaFamilyGroups;
    @OneToMany(mappedBy = "mandator")
    private List&lt;Group&gt; groups;
    @OneToMany(mappedBy = "mandator")
    private List&lt;Department&gt; departments;
    @OneToMany(mappedBy = "mandator")
    private List&lt;CostUnit&gt; costUnits;
  
  
  
  @Entity
    public class Department {
    @Id
    @GeneratedValue
    private Integer id;
    private String name;
    private String responsiblePerson;
    private String location;
  
    @ManyToOne(optional = false)
    private Mandator mandator;
    @ManyToMany
    private List&lt;DocumentUser&gt; documentUsers;
  </code></pre>
  
  <p>I've really tried every thing but it didn't work.</p>