title: Hibernate table doesn't exist
body: <p>When I test my project, just 4 tables are created in the database but not the others and I do not know why. The tables <code>notification</code>, <code>position</code>, <code>dernierePosition</code> and <code>user</code> are created but not the table <code>demande</code> and other tables that I didn't put in this example. There are some properties that i forgot?
  Thanks for your help.
  Here are some files:</p>
  
  <p><strong>hibernate.cfg.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                                           "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
   &lt;session-factory name=""&gt;
    &lt;!-- Database connection settings, Connect to HSQL, IN Memory  --&gt;
    &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/***&lt;/property&gt;
    &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
    &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
    &lt;property name="hibernate.connection.username"&gt;***&lt;/property&gt;
    &lt;property name="hibernate.connection.password"/&gt;
    &lt;!-- DB schema will be updated if needed --&gt;
    &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;
    &lt;!-- JDBC connection pool (use the built-in) 
   List of XML mapping files --&gt;
    &lt;mapping class="modele.Demande" resource="Demande.hbm.xml"/&gt;
    &lt;mapping class="modele.DernierePosition" resource="DernierePosition.hbm.xml"/&gt;
    &lt;mapping class="modele.Group" resource="Group.hbm.xml"/&gt;
    &lt;mapping class="modele.Invitation" resource="Invitation.hbm.xml"/&gt;
    &lt;mapping class="modele.Marqueur" resource="Marqueur.hbm.xml"/&gt;
    &lt;mapping class="modele.Notification" resource="Notification.hbm.xml"/&gt;
    &lt;mapping class="modele.NotificationMarqueur" resource="NotificationMarqueur.hbm.xml"/&gt;
    &lt;mapping class="modele.Position" resource="Position.hbm.xml"/&gt;
    &lt;mapping class="modele.User" resource="User.hbm.xml"/&gt;
   &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p><strong>Position.hbm.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated 15 févr. 2014 01:46:28 by Hibernate Tools 3.4.0.CR1 --&gt;
  &lt;hibernate-mapping&gt;
      &lt;class name="modele.Position" table="POSITION"&gt;
          &lt;id name="id" type="int"&gt;
              &lt;column name="ID" /&gt;
              &lt;generator class="native" /&gt;
          &lt;/id&gt;
          &lt;property name="lattitude" type="double"&gt;
              &lt;column name="LATTITUDE" /&gt;
          &lt;/property&gt;
          &lt;property name="longitude" type="double"&gt;
              &lt;column name="LONGITUDE" /&gt;
          &lt;/property&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p><strong>DenierePosition.hbm.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated 15 févr. 2014 01:46:28 by Hibernate Tools 3.4.0.CR1 --&gt;
  &lt;hibernate-mapping&gt;
      &lt;joined-subclass name="modele.DernierePosition" extends="modele.Position" table="DERNIEREPOSITION" lazy="false"&gt;
          &lt;key&gt;
              &lt;column name="ID" /&gt;
          &lt;/key&gt;
          &lt;property name="time" type="java.util.Date"&gt;
              &lt;column name="TIME" /&gt;
          &lt;/property&gt;
          &lt;one-to-one name="user" class="modele.User"&gt;&lt;/one-to-one&gt;
      &lt;/joined-subclass&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p><strong>Notification.hbm.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated 15 févr. 2014 01:46:28 by Hibernate Tools 3.4.0.CR1 --&gt;
  &lt;hibernate-mapping&gt;
      &lt;class name="modele.Notification" table="NOTIFICATION"&gt;
          &lt;id name="id" type="int"&gt;
              &lt;column name="ID" /&gt;
              &lt;generator class="native" /&gt;
          &lt;/id&gt;
          &lt;many-to-one name="user" class="modele.User" fetch="join"&gt;
              &lt;column name="USER" /&gt;
          &lt;/many-to-one&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p><strong>Demande.java</strong></p>
  
  <pre><code>@XmlRootElement
  public class Demande extends Notification {
  
      private Group group;
  
      private User demandeur;
  
      public Demande(){
  
      }
  
      public Demande(Group group, User demandeur) {
          super(group.getProprietaire());
          this.group = group;
          this.demandeur=demandeur;
      }
  
      // Getters and setters
  
  
  }
  </code></pre>
  
  <p><strong>Demande.hbm.xml</strong></p>
  
  <pre><code>    &lt;?xml version="1.0"?&gt;
      &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
      &lt;!-- Generated 15 févr. 2014 01:46:28 by Hibernate Tools 3.4.0.CR1 --&gt;
  &lt;hibernate-mapping&gt;
      &lt;joined-subclass name="modele.Demande" extends="modele.Notification" table="DEMANDE" lazy="false"&gt;
          &lt;key&gt;
              &lt;column name="ID" /&gt;
          &lt;/key&gt;
          &lt;many-to-one name="group" class="modele.Group" fetch="join"&gt;
              &lt;column name="GROUP" /&gt;
          &lt;/many-to-one&gt;
          &lt;many-to-one name="demandeur" class="modele.User" fetch="join"&gt;
              &lt;column name="DEMANDEUR" /&gt;
          &lt;/many-to-one&gt;
      &lt;/joined-subclass&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p><strong>User.java</strong></p>
  
  <pre><code>@XmlRootElement
  public class User {
  
      /** Attributs */ 
  
      private int id;
  
      private String pseudo;
  
      private String telephone;
  
      private String email;
  
      @XmlTransient
      private Set&lt;Demande&gt; demandes;
  
      @XmlTransient
      private Set&lt;Invitation&gt; aInvite;
  
      @XmlTransient
      private Set&lt;Notification&gt; notifications;
  
      private DernierePosition dernierePosition;
  
      @XmlTransient
      private Set&lt;Group&gt; groups;
  
      @XmlTransient
      private Set&lt;Group&gt; proprietaire;
  
      /** Constructeur */ 
      public User() {
      }
  
      public User(String telephone, String pseudo, String email) {
          super();
          this.pseudo = pseudo;
          this.telephone = telephone;
          this.email = email;
      }
  // Getters and setters
  }
  </code></pre>
  
  <p><strong>User.hbm.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated 15 févr. 2014 01:46:28 by Hibernate Tools 3.4.0.CR1 --&gt;
  &lt;hibernate-mapping&gt;
      &lt;class name="modele.User" table="USER"&gt;
          &lt;id name="id" type="int"&gt;
              &lt;column name="ID" /&gt;
              &lt;generator class="native" /&gt;
          &lt;/id&gt;
          &lt;property name="pseudo" type="java.lang.String"&gt;
              &lt;column name="PSEUDO" /&gt;
          &lt;/property&gt;
          &lt;property name="telephone" type="java.lang.String" not-null="true" unique="true"&gt;
              &lt;column name="TELEPHONE" /&gt;
          &lt;/property&gt;
          &lt;property name="email" type="java.lang.String"&gt;
              &lt;column name="EMAIL" /&gt;
          &lt;/property&gt;
          &lt;set name="demandes" table="DEMANDE" inverse="false" lazy="true"&gt;
              &lt;key&gt;
                  &lt;column name="ID" /&gt;
              &lt;/key&gt;
              &lt;one-to-many class="modele.Demande" /&gt;
          &lt;/set&gt;
          &lt;set name="aInvite" table="INVITATION" inverse="false" lazy="true" access="field"&gt;
              &lt;key&gt;
                  &lt;column name="ID" /&gt;
              &lt;/key&gt;
              &lt;one-to-many class="modele.Invitation" /&gt;
          &lt;/set&gt;
          &lt;set name="notifications" table="NOTIFICATION" inverse="false" lazy="true"&gt;
              &lt;key&gt;
                  &lt;column name="ID" /&gt;
              &lt;/key&gt;
              &lt;one-to-many class="modele.Notification" /&gt;
          &lt;/set&gt;
          &lt;one-to-one name="dernierePosition" class="modele.DernierePosition"&gt;&lt;/one-to-one&gt;
          &lt;set name="groups" table="GROUP" inverse="false" lazy="true"&gt;
              &lt;key&gt;
                  &lt;column name="ID" /&gt;
              &lt;/key&gt;
              &lt;one-to-many class="modele.Group" /&gt;
          &lt;/set&gt;
          &lt;set name="proprietaire" table="GROUP" inverse="false" lazy="true"&gt;
              &lt;key&gt;
                  &lt;column name="ID" /&gt;
              &lt;/key&gt;
              &lt;one-to-many class="modele.Group" /&gt;
          &lt;/set&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p><strong>Group.java</strong></p>
  
  <pre><code>@XmlRootElement
  public class Group {
  
      /** Attributs */
  
      private int id;
  
      private String description;
  
      private String hashtag;
  
      private String password;
  
      private Set&lt;Marqueur&gt; marqueurs;
  
      @XmlTransient
      private Set&lt;Invitation&gt; invitations;
  
      @XmlTransient
      private Set&lt;Demande&gt; demandes;
  
      private User proprietaire;
  
      private Set&lt;User&gt; invites;
  
      /** 
       * Constructeur 
       * */ 
      public Group()
      {
  
      }
  
      public Group(String description, String hashtag, User proprietaire, String password) {
          super();
          this.description = description;
          this.hashtag = hashtag;
          this.proprietaire = proprietaire;
          this.setPassword(password);
      }
  </code></pre>
  
  <p><strong>Group.hbm.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated 16 f?vr. 2014 11:30:30 by Hibernate Tools 3.4.0.CR1 --&gt;
  &lt;hibernate-mapping&gt;
      &lt;class name="modele.Group" table="GROUP"&gt;
          &lt;id name="id" type="int"&gt;
              &lt;column name="ID" /&gt;
              &lt;generator class="assigned" /&gt;
          &lt;/id&gt;
          &lt;property name="description" type="java.lang.String"&gt;
              &lt;column name="DESCRIPTION" /&gt;
          &lt;/property&gt;
          &lt;property name="hashtag" type="java.lang.String"&gt;
              &lt;column name="HASHTAG" /&gt;
          &lt;/property&gt;
          &lt;property name="password" type="java.lang.String"&gt;
              &lt;column name="PASSWORD" /&gt;
          &lt;/property&gt;
          &lt;set name="marqueurs" table="MARQUEUR" inverse="false" lazy="true"&gt;
              &lt;key&gt;
                  &lt;column name="ID" /&gt;
              &lt;/key&gt;
              &lt;one-to-many class="modele.Marqueur" /&gt;
          &lt;/set&gt;
          &lt;set name="invitations" table="INVITATION" inverse="false" lazy="true"&gt;
              &lt;key&gt;
                  &lt;column name="ID" /&gt;
              &lt;/key&gt;
              &lt;one-to-many class="modele.Invitation" /&gt;
          &lt;/set&gt;
          &lt;many-to-one name="proprietaire" class="modele.User" fetch="join"&gt;
              &lt;column name="PROPRIETAIRE" /&gt;
          &lt;/many-to-one&gt;
          &lt;set name="invites" table="USER" inverse="false" lazy="true"&gt;
              &lt;key&gt;
                  &lt;column name="ID" /&gt;
              &lt;/key&gt;
              &lt;one-to-many class="modele.User" /&gt;
          &lt;/set&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p><strong>Test User</strong></p>
  
  <pre><code>package dao;
  
  import java.util.List;
  
  import junit.framework.Assert;
  import modele.User;
  
  import org.junit.Test;
  
  
  public class UserDaoTest {
  
      private final String tel = "0601020304";
      private final String pseudo = "pseudo";
      private final String pseudoModified = "pseudo2";
      private final String email = "email@email.com";
  
      @Test
      public void addUserTest(){
  
          User initialUser = new User(tel, pseudo, email);
  
          UserDao.addUser(initialUser);
  
          User addedUser = UserDao.getUser(tel);
  
          Assert.assertEquals(addedUser.getTelephone(), initialUser.getTelephone());
          Assert.assertEquals(addedUser.getPseudo(), initialUser.getPseudo());
          Assert.assertEquals(addedUser.getEmail(), initialUser.getEmail());
      }
  
      @Test
      public void modifyUserTest(){
          UserDao.modifyUser(tel, pseudoModified, email);
  
          User modifiedUser = UserDao.getUser(tel);
  
          Assert.assertEquals(modifiedUser.getTelephone(), tel);
          Assert.assertEquals(modifiedUser.getPseudo(), pseudoModified);
          Assert.assertEquals(modifiedUser.getEmail(), email);
  
      }
  
      @Test
      public void listUserTest(){
          User modifiedUser = UserDao.getUser(tel);
  
          List&lt;User&gt; listUsers = UserDao.listUser();
  
          User listedUser = listUsers.get(listUsers.indexOf(modifiedUser));
  
          Assert.assertEquals(listedUser.getTelephone(), modifiedUser.getTelephone());
          Assert.assertEquals(listedUser.getPseudo(), modifiedUser.getPseudo());
          Assert.assertEquals(listedUser.getEmail(), modifiedUser.getEmail());
      }
  
      @Test
      public void deleteUserTest(){
          User user = UserDao.getUser(tel);
  
          UserDao.deleteUser(user.getTelephone());
  
          List&lt;User&gt; listUsers = UserDao.listUser();
  
          Assert.assertEquals(listUsers.indexOf(user), -1);
      }
  }
  </code></pre>