title: Initial SessionFactory creation failed.org.hibernate.HibernateException: Missing column: dept_id
body: <pre><code>Initial SessionFactory creation failed.org.hibernate.HibernateException: Missing column: dept_id
  Exception in thread "main" java.lang.ExceptionInInitializerError
      at com.atom.HibernateOne.HibernateUtil.buildSessionFactory(HibernateUtil.java:18)
      at com.atom.HibernateOne.HibernateUtil.&lt;clinit&gt;(HibernateUtil.java:8)
      at com.atom.HibernateOne.Main.main(Main.java:17)
  Caused by: org.hibernate.HibernateException: Missing column: dept_id
      at org.hibernate.mapping.Table.validateColumns(Table.java:212)
      at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:964)
      at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
      at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:296)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1164)
      at com.atom.HibernateOne.HibernateUtil.buildSessionFactory(HibernateUtil.java:15)
  </code></pre>
  
  <hr>
  
  <p>department table</p>
  
  <pre><code>CREATE TABLE `department` (
      `dept_id` BIGINT(20) NOT NULL AUTO_INCREMENT,
      `dept_name` VARCHAR(50) NOT NULL DEFAULT '0',
      PRIMARY KEY (`dept_id`)
  )
  ;
  </code></pre>
  
  <p>employeeo table </p>
  
  <pre><code>CREATE TABLE `employeeo` (
      `employee_id` BIGINT(10) NOT NULL AUTO_INCREMENT,
      `firstname` VARCHAR(50) NULL DEFAULT NULL,
      `lastname` VARCHAR(50) NULL DEFAULT NULL,
      `birth_date` DATE NULL DEFAULT NULL,
      `cell_phone` VARCHAR(15) NULL DEFAULT NULL,
      `deptest.departmentt_id` BIGINT(20) NULL DEFAULT NULL,
      PRIMARY KEY (`employee_id`),
      INDEX `FK_DEPT` (`dept_id`),
      CONSTRAINT `FK_DEPT` FOREIGN KEY (`dept_id`) REFERENCES `department` (`dept_id`)
  );
  </code></pre>
  
  <hr>
  
  <p>department.hbm.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC
          "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  
  &lt;hibernate-mapping package="com.atom.HibernateOne"&gt;
  
       &lt;class name="com.atom.HibernateOne.Department" table="department"&gt;
  
          &lt;id name="departmentId" type="java.lang.Long" column="dept_id" &gt;
              &lt;generator class="identity" /&gt;
          &lt;/id&gt;
  
          &lt;property name="departmentName" column="DEPT_NAME"/&gt;
  
          &lt;set name="employees" 
               table="EMPLOYEEO"
               inverse="true" 
               fetch="select"&gt;
  
              &lt;key&gt;
                  &lt;column name="dept_id" 
                          not-null="true" /&gt;
              &lt;/key&gt;
  
              &lt;one-to-many class="com.atom.HibernateOne.EmployeeO" /&gt;
          &lt;/set&gt;
  
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <hr>
  
  <p>employeeo.hbm.xml</p>
  
  <p>
  </p>
  
  <p></p>
  
  <pre><code> &lt;class name="com.atom.HibernateOne.EmployeeO" table="EMPLOYEE"&gt;
      &lt;id name="employeeId" column="EMPLOYEE_ID"&gt;
      &lt;/id&gt;
  
      &lt;property name="firstname" column="FIRSTNAME"/&gt;
      &lt;property name="lastname" column="LASTNAME" /&gt;
      &lt;property name="birthDate" type="date" column="BIRTH_DATE" /&gt;
      &lt;property name="cellphone" column="CELL_PHONE" /&gt;
  
  
      &lt;many-to-one name="department" class="com.atom.HibernateOne.Department" fetch="select"&gt;
          &lt;column name="dept_id" not-null="true" /&gt;
      &lt;/many-to-one&gt;
  
  &lt;/class&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>* Initial SessionFactory creation failed.org.hibernate.HibernateException: Missing column: dept_id*</strong></p>
  
  <p>I am not able to understand the occurrence of error </p>