title: SQLSyntaxErrorException: Table/View does not exist
body: <p>I'm getting a large stack trace which at its root is caused by: <code>java.sql.SQLSyntaxErrorException: Table/View 'U' does not exist.</code> Followed by an exception for everything that requires the entity: <code>java.sql.SQLTransactionRollbackException: Constraint 'PSSVSERSRDTABASEID' is invalid: referenced table U does not exist.</code></p>
  
  <p>I looked at <a href="https://stackoverflow.com/questions/22996818/is-it-necessary-to-create-tables-each-time-you-connect-the-derby-database/23051822#23051822">this question and answer</a> about a similar issue but it doesn't seem to address my particular problem. The reason being is when I open <code>Database Development</code> mode in Eclipse, I can see every other entity being mapped to a table, yet, not the entity User('U'). </p>
  
  <p>The User entity:</p>
  
  <pre><code>@Entity
  @Inheritance(strategy = InheritanceType.JOINED)
  @DiscriminatorColumn(name = "disc", discriminatorType = DiscriminatorType.STRING)
  @Table(name = "U")
  @NamedQuery(name = "FIND_WITH_USER_ID", query="SELECT DISTINCT u FROM User u WHERE u.userId = :userId")
  public class User implements Serializable{
      private static final long serialVersionUID = 2468889149889625824L;
      @Id @GeneratedValue
      protected long databaseId;
  
      //getters/setters/etc
  
  }
  </code></pre>
  
  <p>User does have a subclass (which shows up in the table schema):</p>
  
  <pre><code>@Entity
  public class Customer extends User{
      private static final long serialVersionUID = -5239293307816318553L;
  
      public Customer(){
          super();
      } 
  
      //getters/setters/etc
  
  }
  </code></pre>
  
  <p>In my persistence.xml file, I do specify for the tables to be created if they don't already exist:</p>
  
  <pre><code>&lt;properties&gt;
          &lt;property name="javax.persistence.jdbc.driver" value="C:\Program Files\GlassFish\glassfish-4.1\glassfish4\javadb\lib\derby.jar"&gt;&lt;/property&gt;
          &lt;property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/AppDB;create=true"&gt;&lt;/property&gt;
          &lt;property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <p>As stated, other tables are shown in the database schema (and pings to the database succeed). The problem seems to form around the User entity. I thought it might have had something to do with reserved keyword name clashes, so I changed the name of the table a few times (there seems to be a problem with Eclipse/Glassfish once I encounter this exception, even if I make changes, such as the name, and relaunch the app it doesn't update; out of scope of question I believe). </p>
  
  <p><strong>Why isn't a table being created for entity User?</strong> What am I missing? Why are the other tables being created still?</p>