title: Hibernate insert with single column table problem
body: <p>I'm using Hibernate with a SQLite database. I have the following class :</p>
  
  <pre><code>@Entity
  @Inheritance(strategy=InheritanceType.JOINED)
  public abstract class Authority {
  
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      private int idAuthority;
  (...)
  </code></pre>
  
  <p>I then have a class Author, that extends Authority and add 4 or 5 fields. 
  When I try to save an Author object, Hibernate generates the following request :</p>
  
  <pre><code> Hibernate: insert into Authority values ( )
  </code></pre>
  
  <p>And sqlite doesn't like that.</p>
  
  <p>If I add a dummy String field, like "private String test" and set this property in the constructor, everything works fine.</p>
  
  <p>I'm quite new to hibernate, so I'm not sure how to proceed. Do you have any idea ?</p>
  
  <p><strong>Edit</strong> : As requested, the mapping of the Author class :</p>
  
  <pre><code>@Entity
  @Table(name="Authors")
  @PrimaryKeyJoinColumn(name="idAuthority")
  public class Author extends Authority {
  
      @Column(name = "firstName")
      protected String firstName;
      @Column(name = "lastName")
      protected String lastName;
      @Column(name = "alias")
      protected String alias;
  (...)
  }
  </code></pre>
  
  <p><strong>Edit</strong> : As requested (bis), the insert code :</p>
  
  <pre><code>public void save(Object data) {
       currentSession.saveOrUpdate(data);
  }
  </code></pre>
  
  <p>Nothing fancy...
  And to give you more possible leads, here is the database schema :</p>
  
  <pre><code>create table Authority (idAuthority  integer, primary key (idAuthority))
  create table Authors (alias varchar, firstName varchar, 
  lastName varchar, idAuthority bigint not null, primary key (idAuthority))
  </code></pre>
  
  <p>N.B. : in SQLite, an integer that is primary key is automatically set to AUTO-INCREMENT.</p>
  
  <p>The Exception raised is this one :</p>
  
  <pre><code>java.sql.SQLException: near ")": syntax error
  </code></pre>
  
  <p>The request should be more like : insert into Authority values (NULL) to let SQLite do its auto-increment, not this weird "insert into Authority values ()". </p>
  
  <p><strong>Edit :</strong> This is definetely a problem with the SqlLite for Hibernate package. I just tried with Hsqldb, and it gives me a proper query : </p>
  
  <pre><code>insert into Authority (idAuthority) values (default)
  </code></pre>
  
  <p>(Then it fails too, but for very different reasons :p ).</p>
  
  <p>I'm not sure there is a solution to this problem... other than using a different DB.</p>