title: Hibernate Exception: Missing Column (column exists)
body: <p>Okay, so within the database we have a table called distributionCompanies, created like so:</p>
  
  <pre><code>CREATE TABLE `distributionCompanies` (
      `distributionCompanyID` INT(11) NOT NULL,
      `distributionCompanyName` VARCHAR(255) NOT NULL,
       PRIMARY KEY (distributionCompanyID)
  );
  </code></pre>
  
  <p>I'm trying to map this table to a class using Hibernate:</p>
  
  <pre><code>@Entity
  @Table(name = "distributionCompanies")
  public class DistributionCompany implements DatabaseObject {
      @Id
      @GeneratedValue
      @Column(name = "distributionCompanyID", length = 11, unique = true, nullable = false)
      private int distributionCompanyID;
  ....
  </code></pre>
  
  <p>However, when running, I hit this issue:</p>
  
  <pre><code>Initial SessionFactory creation failedorg.hibernate.HibernateException: Missing column: distributionCompanyID_distributionCompanyID in database2.distributionCompanies
  </code></pre>
  
  <p>This isn't the only table in the database, and I've managed to map other classes successfully using the same method, so I'm a little stumped as to why this is causing an issue.</p>
  
  <p>Thank you for your time,
  Samuel Smith</p>
  
  <p>EDIT: In response to Xavi's comment, I temporarily removed another mapping for the column, and the error went away, so the bad-egg probably lays in the following code:</p>
  
  <pre><code>@ManyToOne(targetEntity = DistributionCompany.class)
  @JoinTable(name = "distributionCompanies", joinColumns = { @JoinColumn(name =    "distributionCompanyID", nullable = false) })
  private int distributionCompanyID;
  </code></pre>