title: Hibernate - Unsuccessful: create table
body: <p>When I create the hibernate database, Hibernate recognizes all the tables except for one. So, when I try to save something in there, I get an exception because the object does not exist. 
  The table which fails to create is ORDER. Here is the code:</p>
  
  <pre><code>@Entity
  @Table(name = "ORDER")
  public class Order implements Serializable {
      @Id
      @GeneratedValue(strategy = GenerationType.TABLE)
      @Column(name = "order_id")
      private double order_id;
      @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
      @JoinTable(name = "INORDER", joinColumns = {@JoinColumn(name = "order_id")}, inverseJoinColumns = {
              @JoinColumn(name = "item_id")})
      private List&lt;Item&gt; items;
      @Column(name = "delivered")
      private boolean delivered;
      @Column(name = "current_date")
      private Date current_date;
      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = "user_id")
      private Client client;
      @ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = "address_id")
      private Address address;
      @Column(name = "order_price")
      private float order_price;
  
      public Order() {
  
      }
  
      public Order(Client client, Address address, float order_price, List&lt;Item&gt; items) {
          this.client = client;
          this.address = address;
          this.order_price = order_price;
          this.items = items;
          current_date = new Date();
          delivered = false;
      }
  
      public double getOrder_id() {
          return order_id;
      }
  
      public List&lt;Item&gt; getItems() {
          return items;
      }
  
      public boolean isDelivered() {
          return delivered;
      }
  
      public void confirmDelivery() {
          delivered = true;
      }
  
      public Date getCurrent_date() {
          return current_date;
      }
  
      public Client getClient() {
          return client;
      }
  
      public Address getAddress() {
          return address;
      }
  
  
      public float getOrder_price() {
          return order_price;
      }
  }
  </code></pre>
  
  <p>and the hibernate.cfg.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration SYSTEM
          "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
  
          &lt;!-- Database connection settings --&gt;
          &lt;property name="connection.driver_class"&gt;org.hsqldb.jdbcDriver&lt;/property&gt;
          &lt;property name="connection.url"&gt;jdbc:hsqldb:hsql://localhost/onlineShop&lt;/property&gt;
          &lt;property name="connection.username"&gt;sa&lt;/property&gt;
          &lt;property name="connection.password"&gt;&lt;/property&gt;
  
  
          &lt;!-- database pooling information --&gt;
          &lt;property name="connection_provider_class"&gt;org.hibernate.connection.C3P0ConnectionProvider
          &lt;/property&gt;
          &lt;property name="c3p0.minPoolSize"&gt;5&lt;/property&gt;
          &lt;property name="c3p0.timeout"&gt;1000&lt;/property&gt;
  
          &lt;!-- using container-managed JNDI
          &lt;property name="hibernate.connection.datasource"&gt;
             java:comp/env/jdbc/LiveDataSource
          &lt;/property&gt;   --&gt;
  
  
          &lt;property name="hibernate.connection.CharSet"&gt;utf8&lt;/property&gt;
          &lt;property name="hibernate.connection.characterEncoding"&gt;utf8&lt;/property&gt;
          &lt;property name="hibernate.connection.useUnicode"&gt;true&lt;/property&gt;
  
  
  
          &lt;!-- SQL dialect --&gt;
          &lt;property name="dialect"&gt;org.hibernate.dialect.HSQLDialect&lt;/property&gt;
  
          &lt;!-- Echo all executed SQL to stdout --&gt;
          &lt;property name="show_sql"&gt;true&lt;/property&gt;
  
          &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;
  
          &lt;mapping class="model.Address"/&gt;
          &lt;mapping class="model.Admin"/&gt;
          &lt;mapping class="model.Order"/&gt;
          &lt;mapping class="model.Brand"/&gt;
          &lt;mapping class="model.Client"/&gt;
          &lt;mapping class="model.GenericItem"/&gt;
          &lt;mapping class="model.Item"/&gt;
          &lt;mapping class="model.User"/&gt;
  
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Also, if it's helpful, the error:</p>
  
  <blockquote>
    <p>jul 21, 2014 4:04:45 AM org.apache.catalina.core.AprLifecycleListener
    init WARN: HHH000022: c3p0 properties were encountered, but the
    org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider
    provider class was not found on the classpath; these properties are
    going to be ignored. jul 21, 2014 4:05:14 AM
    org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl
    configure ERROR: HHH000388: Unsuccessful: create table ORDER (order_id
    double not null, current_date timestamp, delivered boolean,
    order_price float, address_id double, user_id double, primary key
    (order_id)) jul 21, 2014 4:05:15 AM
    org.hibernate.tool.hbm2ddl.SchemaUpdate execute ERROR: palabra no
    esperado: ORDER jul 21, 2014 4:05:15 AM
    org.hibernate.tool.hbm2ddl.SchemaUpdate execute ERROR: HHH000388:
    Unsuccessful: alter table INORDER add constraint FK9F407529258ABBD5
    foreign key (order_id) references ORDER jul 21, 2014 4:05:15 AM
    org.hibernate.tool.hbm2ddl.SchemaUpdate execute ERROR: palabra no
    esperado: ORDER jul 21, 2014 4:05:15 AM
    org.hibernate.tool.hbm2ddl.SchemaUpdate execute ERROR: HHH000388:
    Unsuccessful: alter table ORDER add constraint FK47F8F2E1433E755
    foreign key (address_id) references ADDRESS jul 21, 2014 4:05:15 AM
    org.hibernate.tool.hbm2ddl.SchemaUpdate execute ERROR: usuario no
    tiene privilegios suficientes o objeto no encontrado: PUBLIC.ORDER jul
    21, 2014 4:05:15 AM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
    ERROR: HHH000388: Unsuccessful: alter table ORDER add constraint
    FK47F8F2E858D485F foreign key (user_id) references CLIENT jul 21, 2014
    4:05:15 AM org.hibernate.tool.hbm2ddl.SchemaUpdate execute ERROR:
    usuario no tiene privilegios suficientes o objeto no encontrado:
    PUBLIC.ORDER jul 21, 2014 4:05:15 AM
    org.hibernate.tool.hbm2ddl.SchemaUpdate execute WARN: SQL Error:
    -5501, SQLState: 42501 jul 21, 2014 4:05:17 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions ERROR:
    usuario no tiene privilegios suficientes o objeto no encontrado: ORDER</p>
  </blockquote>