title: 'ALTER TABLE' cannot be performed because table does not exist
body: <p>I'm using JPA 2 with Eclipselink 2 and a Derby in memory db for my tests. When I start my little test programm I get the following exception:</p>
  
  <blockquote>
    <p>[EL Warning]: 2010-08-12 17:17:44.943--ServerSession(948252856)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLSyntaxErrorException: 'ALTER TABLE' cannot be performed on 'ARTICLE_ARTICLE' because it does not exist.
    Error Code: 30000
    Call: ALTER TABLE ARTICLE_ARTICLE DROP CONSTRAINT RTCLrtclsRltdTThsD
    Query: DataModifyQuery(sql="ALTER TABLE ARTICLE_ARTICLE DROP CONSTRAINT RTCLrtclsRltdTThsD")</p>
  </blockquote>
  
  <p>If I try the same with HyperSQL (hsqldb) I get:</p>
  
  <blockquote>
    <p>[EL Warning]: 2010-08-12 17:47:33.179--ServerSession(1925661675)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: user lacks privilege or object not found: ARTICLE_ARTICLE
    Error Code: -5501
    Call: ALTER TABLE ARTICLE_ARTICLE DROP CONSTRAINT FK_ARTICLE_ARTICLE_articlesRelatedToThis_ID
    Query: DataModifyQuery(sql="ALTER TABLE ARTICLE_ARTICLE DROP CONSTRAINT FK_ARTICLE_ARTICLE_articlesRelatedToThis_ID")</p>
  </blockquote>
  
  <p>The table generation strategy is "drop-and-create", so why does Eclipselink tell me that a table would not exist?</p>
  
  <p>Or is something wrong with my example class?</p>
  
  <pre><code>@Entity
  public class Article implements Serializable {
  
      @Id @GeneratedValue
      private int id;
      private String title;
    @ManyToMany(mappedBy = "relatedArticles")
    private Set&lt;Article&gt; articlesRelatedToThis = new HashSet&lt;Article&gt;();
    @ManyToMany(cascade = CascadeType.PERSIST)
    private Set&lt;Article&gt; relatedArticles = new HashSet&lt;Article&gt;();
  
    public Article() {}
  
    public Article(String title) {
      this.title = title;
    }
  
    public int getId() {
      return id;
    }
  
    public String getTitle() {
      return title;
    }
  
    public void setTitle(String title) {
      this.title = title;
    }
  
    public Set&lt;Article&gt; getRelatedArticles() {
      return relatedArticles;
    }
  
    public void addRelatedArticle(Article related) {
      relatedArticles.add(related);
    }
  
    public void removeRelatedArticle(Article related) {
      relatedArticles.remove(related);
    }
  
    @PreRemove
    public void preRemove() {
      for(Article article : articlesRelatedToThis)
        article.removeRelatedArticle(this);
    }
  }
  </code></pre>