title: Table is not creating using JPA 2.0
body: <p>I am using JPA 2.0 in Netbeans. I am using entities. If my database has no table then it should create table from entities. Here is my code</p>
  
  <pre><code>public class BankServlet extends HttpServlet {
  
       @EJB
       private BankServiceBeanRemote bankServiceBean;
  
       protected void processRequest(HttpServletRequest request, HttpServletResponse response)
  throws ServletException, IOException {
  
          int custId = Integer.parseInt(request.getParameter("id"));
  
          bankServiceBean.createCustomers();
          Customer cust = bankServiceBean.findCustomer(custId);
  
          response.setContentType("text/html;charset=UTF-8");
          ....
  
      } //end of processRequest
  
  } //end of class BankServlet
  </code></pre>
  
  <p>Here is my bean</p>
  
  <pre><code>@Stateless
  public class BankServiceBean implements BankServiceBeanRemote {
  
      @PersistenceContext(unitName = "Bank_JPA-ejbPU")
      private EntityManager em;
  
      @Override
      public void createCustomers() {
  
          Referee r1 = new Referee();
          r1.setId(1);
          r1.setName("SIR JOHN DEED");
          r1.setComments("JUDGE");     
          em.persist(r1);
  
          Customer c1 = new Customer();
          c1.setId(1);
          c1.setFirstName("SIMON");
          c1.setLastName("KING");
          c1.setReferee(r1);
  
          ......
      }
  
  } //end of class BankServiceBean
  </code></pre>
  
  <p>Here is my referee entity</p>
  
  <pre><code>@Entity
  public class Referee implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      private int id;
      private String name;
      private String comments;
  
      public Referee() {
  
      }
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      // other getter setters
  
  } //end of class Referee
  </code></pre>
  
  <p>When i run the code i get following exception</p>
  
  <pre><code>Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.1.v20100213-r6600):     org.eclipse.persistence.exceptions.DatabaseException
  Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table     'dbbank.referee' doesn't exist
  Error Code: 1146
  Call: INSERT INTO REFEREE (ID, NAME, COMMENTS) VALUES (?, ?, ?)
      bind =&gt; [3, MICHAEL ELLIS, MAJOR SHAREHOLDER OF THIS BANK]
  Query: InsertObjectQuery(pk.mazars.basitMahmood.entity.Referee[id=3])
      at     org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
  </code></pre>
  
  <p>If table doesnot exist then it should create table automatically. Am i doing something wrong?</p>
  
  <p>Thank you</p>